diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c index d35c7ac..4e58a7f 100644 --- a/libavcodec/sgienc.c +++ b/libavcodec/sgienc.c @@ -35,6 +35,11 @@ typedef struct SgiContext { 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;