summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Bandurski <ami_stuff@o2.pl>2012-05-31 20:10:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-07 00:55:25 +0200
commitac3fc94eb0f79685a3e10363032d68142b15e368 (patch)
tree2fb439ee8d02068e7f3c5da719e5e454a6a907a9
parentd838c408232472556d1b767e78bc93cbb6239106 (diff)
downloadffmpeg-ac3fc94eb0f79685a3e10363032d68142b15e368.tar.gz
sgienc: add a limit for maximum supported resolution
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 59352cc219c4f933c9a83b45043ec4810c2a51ee) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/sgienc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c
index d35c7ac5d1..8bb0aba1af 100644
--- a/libavcodec/sgienc.c
+++ b/libavcodec/sgienc.c
@@ -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;