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>
Unified · Split
| @@ -766,8 +766,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame) · 765 unmodified lines | ||
| 766 | 766 | |
| 767 | 767 | switch (avctx->codec->type) { |
| 768 | 768 | case AVMEDIA_TYPE_VIDEO: |
| 769 | − if (frame->format < 0) | |
| 770 | − frame->format = avctx->pix_fmt; | |
| 769 | + frame->format = avctx->pix_fmt; | |
| 771 | 770 | if (!frame->sample_aspect_ratio.num) |
| 772 | 771 | frame->sample_aspect_ratio = avctx->sample_aspect_ratio; |
| 773 | 772 | if (av_frame_get_colorspace(frame) == AVCOL_SPC_UNSPECIFIED) |