aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-16 01:28:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-16 04:55:02 +0100
commit67b943ad661eb0f620448b1c8bc0d8089822ee5b (patch)
treea4218a6830972599ffaee5ff9e171746a39e1f7b /libavcodec/utils.c
parent5e7e43c33ea45550137f5dd2b9f81deef2acbfcd (diff)
downloadffmpeg-67b943ad661eb0f620448b1c8bc0d8089822ee5b.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 (cherry picked from commit 4f94e1901a1ff0073c64122c577b6efd3dee22d4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to '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 9acf7bd770..5f58fb0ad2 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -640,8 +640,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;
break;