[vlc-commits] codec: avcodec: check avcodec visible sizes

Francois Cartegnie git at videolan.org
Thu Jun 29 09:46:53 CEST 2017


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jun 29 09:45:20 2017 +0200| [6cc73bcad19da2cd2e95671173f2e0d203a57e9b] | committer: Francois Cartegnie

codec: avcodec: check avcodec visible sizes

refs #18467

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=6cc73bcad19da2cd2e95671173f2e0d203a57e9b
---

 modules/codec/avcodec/video.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 1bcad21ad2..ce5254423e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -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;



More information about the vlc-commits mailing list