]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/vqavideo: Limit resolution
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 22 Aug 2019 17:39:29 +0000 (19:39 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 5 Sep 2019 17:45:53 +0000 (19:45 +0200)
Fixes: Timeout (288sec -> 1ms)
Fixes: 16353/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-5633402606190592
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/vqavideo.c

index b9743abda95dee28a9623d42af7439358a605c74..f45390cfe54caba46f18026dd233977da2d023cb 100644 (file)
@@ -637,6 +637,11 @@ static av_cold int vqa_decode_end(AVCodecContext *avctx)
     return 0;
 }
 
+static const AVCodecDefault vqa_defaults[] = {
+    { "max_pixels", "320*240" },
+    { NULL },
+};
+
 AVCodec ff_vqa_decoder = {
     .name           = "vqavideo",
     .long_name      = NULL_IF_CONFIG_SMALL("Westwood Studios VQA (Vector Quantized Animation) video"),
@@ -647,4 +652,5 @@ AVCodec ff_vqa_decoder = {
     .close          = vqa_decode_end,
     .decode         = vqa_decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .defaults       = vqa_defaults,
 };