codec: avcodec: check avcodec visible sizes
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 29 Jun 2017 07:45:20 +0000 (09:45 +0200)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 5 Sep 2017 17:37:57 +0000 (18:37 +0100)
refs #18467

Gbp-Pq: Name 0011-codec-avcodec-check-avcodec-visible-sizes.patch

modules/codec/avcodec/video.c

index a19e7f6e4ee48ea51655b65a3281f87d4eb89e17..b8b713f95bd0a6b31342e5fff0a23ad9f0511473 100644 (file)
@@ -137,9 +137,11 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
     }
 
 
-    if( width == 0 || height == 0 || width > 8192 || height > 8192 )
+    if( width == 0 || height == 0 || width > 8192 || height > 8192 ||
+        width < p_context->width || height < p_context->height )
     {
-        msg_Err( p_dec, "Invalid frame size %dx%d.", width, height );
+        msg_Err( p_dec, "Invalid frame size %dx%d. vsz %dx%d",
+                 width, height, p_context->width, p_context->height );
         return NULL; /* invalid display size */
     }
     p_dec->fmt_out.video.i_width = width;