diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-08 17:33:39 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-08 17:33:39 +0200 |
commit | 7c7441b37de1b2753062251464072cc766fa7904 (patch) | |
tree | f12d7cdf797162e1415970dd6f730ad11fd46bce /libavcodec/roqvideoenc.c | |
parent | fe4c76b3d09fb1d93efd438fac35ef16324d40cb (diff) | |
download | ffmpeg-7c7441b37de1b2753062251464072cc766fa7904.tar.gz |
avcodec/roqvideoenc: check dimensions against maximum
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/roqvideoenc.c')
-rw-r--r-- | libavcodec/roqvideoenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index 6530ec7d38..a950a4e865 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -972,6 +972,11 @@ static av_cold int roq_encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } + if (avctx->width > 65535 || avctx->height > 65535) { + av_log(avctx, AV_LOG_ERROR, "Dimensions are max 32768\n"); + return AVERROR(EINVAL); + } + if (((avctx->width)&(avctx->width-1))||((avctx->height)&(avctx->height-1))) av_log(avctx, AV_LOG_ERROR, "Warning: dimensions not power of two\n"); |