---
 libavcodec/sgidec.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
index 91b68eb..bf717b0 100644
--- a/libavcodec/sgidec.c
+++ b/libavcodec/sgidec.c
@@ -187,6 +187,13 @@ static int decode_frame(AVCodecContext *avctx,
         return -1;
     }
 
+    /* Check for supported image size. */
+    if (avctx->width > 65535 || avctx->height > 65535) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Unsupported resolution %dx%d\n", avctx->width, avctx->height);
+        return AVERROR_INVALIDDATA;
+    }
+
     /* Check for supported image dimensions. */
     if (dimension != 2 && dimension != 3) {
         av_log(avctx, AV_LOG_ERROR, "wrong dimension number\n");
-- 
1.8.3.4 (Apple Git-47)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to