[FFmpeg-cvslog] sgi: check maximum supported resolution

Piotr Bandurski git at videolan.org
Tue Apr 1 03:43:01 CEST 2014


ffmpeg | branch: master | Piotr Bandurski <ami_stuff at o2.pl> | Thu May 31 20:10:04 2012 +0200| [e7cd53bf662a93330810981f1d057bdf2ead669e] | committer: Vittorio Giovara

sgi: check maximum supported resolution

Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>

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

 libavcodec/sgienc.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c
index ab1e36f..003f6be 100644
--- a/libavcodec/sgienc.c
+++ b/libavcodec/sgienc.c
@@ -30,6 +30,12 @@
 
 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);



More information about the ffmpeg-cvslog mailing list