summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-16 01:28:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-23 14:28:10 +0100
commitf8985cb9d995cb44f7ca957cdbd9b4d8654c9218 (patch)
tree6ab35875a79c031117053c9c6d8d73f3376c0ceb
parent656770e2aacf44df2be01ee7fd60b035fd42c675 (diff)
downloadffmpeg-f8985cb9d995cb44f7ca957cdbd9b4d8654c9218.tar.gz
avcodec/utils: set AVFrame format unconditional
Fixes inconsistency and out of array accesses Fixes: 10cdd7e63e7f66e3e66273939e0863dd-asan_heap-oob_1a4ff32_7078_cov_4056274555_mov_h264_aac__mp4box_frag.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit e5c7229999182ad1cef13b9eca050dba7a5a08da) Conflicts: libavcodec/utils.c
-rw-r--r--libavcodec/utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 25bb24580f..9cef9b7f99 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -733,8 +733,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
case AVMEDIA_TYPE_VIDEO:
frame->width = FFMAX(avctx->width, FF_CEIL_RSHIFT(avctx->coded_width, avctx->lowres));
frame->height = FFMAX(avctx->height, FF_CEIL_RSHIFT(avctx->coded_height, avctx->lowres));
- if (frame->format < 0)
- frame->format = avctx->pix_fmt;
+ frame->format = avctx->pix_fmt;
if (!frame->sample_aspect_ratio.num)
frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED)