aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Bandurski <ami_stuff@o2.pl>2012-05-31 20:10:04 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-04-01 01:13:18 +0200
commite7cd53bf662a93330810981f1d057bdf2ead669e (patch)
tree96dc49e7e7b9d566f1842475540e5f5e9fc4e9ef
parenta7dbfcf6cb6ab8a8981d74332fd02fb90360d22f (diff)
downloadffmpeg-e7cd53bf662a93330810981f1d057bdf2ead669e.tar.gz
sgi: check maximum supported resolution
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
-rw-r--r--libavcodec/sgienc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c
index ab1e36ff78..003f6be484 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);