mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-01-05 21:55:37 +01:00
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 e5c7229999)
Conflicts:
libavcodec/utils.c
(cherry picked from commit 4f94e1901a1ff0073c64122c577b6efd3dee22d4)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user