sgienc: add a limit for maximum supported resolution
authorPiotr Bandurski <ami_stuff@o2.pl>
Thu, 31 May 2012 18:10:04 +0000 (20:10 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Jun 2012 22:55:25 +0000 (00:55 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59352cc219c4f933c9a83b45043ec4810c2a51ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/sgienc.c

index d35c7ac..8bb0aba 100644 (file)
@@ -36,6 +36,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
 {
     SgiContext *s = avctx->priv_data;
 
+    if (avctx->width > 65535 || avctx->height > 65535) {
+        av_log(avctx, AV_LOG_ERROR, "SGI does not support resolutions above 65535x65535\n");
+        return -1;
+    }
+
     avcodec_get_frame_defaults(&s->picture);
     avctx->coded_frame = &s->picture;