Avoid a null pointer dereference in avcodec_decode_audio4().
This could happen if oom occured while probing a file. Fixes ticket #2722.
This commit is contained in:
		
							parent
							
								
									ec837a0899
								
							
						
					
					
						commit
						b42bcaef29
					
				| @ -2061,6 +2061,8 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx, | |||||||
|         av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n"); |         av_log(avctx, AV_LOG_ERROR, "invalid packet: NULL data, size != 0\n"); | ||||||
|         return AVERROR(EINVAL); |         return AVERROR(EINVAL); | ||||||
|     } |     } | ||||||
|  |     if (!avctx->codec) | ||||||
|  |         return AVERROR(EINVAL); | ||||||
|     if (avctx->codec->type != AVMEDIA_TYPE_AUDIO) { |     if (avctx->codec->type != AVMEDIA_TYPE_AUDIO) { | ||||||
|         av_log(avctx, AV_LOG_ERROR, "Invalid media type for audio\n"); |         av_log(avctx, AV_LOG_ERROR, "Invalid media type for audio\n"); | ||||||
|         return AVERROR(EINVAL); |         return AVERROR(EINVAL); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user