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

Francois Cartegnie git at videolan.org
Thu Jun 29 09:59:48 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jun 29 09:49:37 2017 +0200| [e050dc2535f82db639402e40f3cf971e209db8dc] | committer: Francois Cartegnie

codec: avcodec: check avcodec visible sizes

refs #18467

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

 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 ef9a8a769a..0a0379ac28 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -154,9 +154,11 @@ static int lavc_GetVideoFormat(decoder_t *dec, video_format_t *restrict fmt,
     else /* hardware decoding */
         fmt->i_chroma = vlc_va_GetChroma(pix_fmt, sw_pix_fmt);
 
-    if( width == 0 || height == 0 || width > 8192 || height > 8192 )
+    if( width == 0 || height == 0 || width > 8192 || height > 8192 ||
+        width < ctx->width || height < ctx->height )
     {
-        msg_Err(dec, "Invalid frame size %dx%d.", width, height);
+        msg_Err(dec, "Invalid frame size %dx%d vsz %dx%d",
+                     width, height, ctx->width, ctx->height );
         return -1; /* invalid display size */
     }
 



More information about the vlc-commits mailing list