sgi: check maximum supported resolution
authorPiotr Bandurski <ami_stuff@o2.pl>
Thu, 31 May 2012 18:10:04 +0000 (20:10 +0200)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 31 Mar 2014 23:13:18 +0000 (01:13 +0200)
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavcodec/sgienc.c

index ab1e36f..003f6be 100644 (file)
 
 static av_cold int encode_init(AVCodecContext *avctx)
 {
+    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;
+    }
+
     avctx->coded_frame = av_frame_alloc();
     if (!avctx->coded_frame)
         return AVERROR(ENOMEM);