diff options
author | Piotr Bandurski <ami_stuff@o2.pl> | 2012-05-31 13:49:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-31 16:57:47 +0200 |
commit | d2581dcca6abe74e3fbf44df815194a6aea71bd6 (patch) | |
tree | ce4edad14934f0cecc3576c11d6a4a2582dfbb12 /libavcodec/mjpegenc.c | |
parent | 320e537baf241ccfa5187f2c7cdd758e74d88d4d (diff) | |
download | ffmpeg-d2581dcca6abe74e3fbf44df815194a6aea71bd6.tar.gz |
mjpegenc: add a limit for maximum supported resolution
jpeg does not allow more than 65000 pixels for width and height
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegenc.c')
-rw-r--r-- | libavcodec/mjpegenc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 9326d4d9f4..53a45b4c4c 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -48,6 +48,11 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s) { MJpegContext *m; + if (s->width > 65500 || s->height > 65500) { + av_log(s, AV_LOG_ERROR, "JPEG does not support resolutions above 65500x65500\n"); + return -1; + } + m = av_malloc(sizeof(MJpegContext)); if (!m) return -1; |