summaryrefslogtreecommitdiff
path: root/libavcodec
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 01:34:35 +0100
commite5c7229999182ad1cef13b9eca050dba7a5a08da (patch)
tree3687ae75667d56ee0498b1749a7cf64b16d7605c /libavcodec
parentd1e6602665d5ec1b7e211ab27b298c26139f82cc (diff)
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ea7765493a..5d318dc77f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -766,8 +766,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
switch (avctx->codec->type) {
case AVMEDIA_TYPE_VIDEO:
- 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)