From ac3fc94eb0f79685a3e10363032d68142b15e368 Mon Sep 17 00:00:00 2001 From: Piotr Bandurski Date: Thu, 31 May 2012 20:10:04 +0200 Subject: sgienc: add a limit for maximum supported resolution Signed-off-by: Michael Niedermayer (cherry picked from commit 59352cc219c4f933c9a83b45043ec4810c2a51ee) Signed-off-by: Michael Niedermayer --- libavcodec/sgienc.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3