Quellcode durchsuchen

avcodec/dxv: Check coded_height, to avoid invalid av_clip()

Fixes: assertion failure
Fixes: 438961582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5850827739955200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cdee519d40e61bd65ba5b3fbec00acd50a08d0d9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Michael Niedermayer vor 3 Monaten
Ursprung
Commit
c8d0bb8966
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  1. 2 0
      libavcodec/dxv.c

+ 2 - 0
libavcodec/dxv.c

@@ -1147,6 +1147,8 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
         ctx->tex_rat = 1;
         break;
     }
+    if (avctx->coded_height / 2 / TEXTURE_BLOCK_H < 1)
+        return AVERROR_INVALIDDATA;
 
     ctx->slice_count = av_clip(avctx->thread_count, 1,
                                avctx->coded_height / FFMAX(ctx->texture_block_h,