Browse Source

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>
tags/n1.0
Piotr Bandurski Michael Niedermayer 13 years ago
parent
commit
d2581dcca6
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/mjpegenc.c

+ 5
- 0
libavcodec/mjpegenc.c View File

@@ -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;


Loading…
Cancel
Save