[FFmpeg-devel] [PATCH] mjpegdec: check for maximum allowed resolution

Michael Niedermayer michaelni at gmx.at
Thu May 31 17:06:05 CEST 2012


On Thu, May 31, 2012 at 05:02:58PM +0200, Piotr Bandurski wrote:
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index a2fe7e3..a8c0f28 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -85,6 +85,11 @@ static void build_basic_mjpeg_vlc(MJpegDecodeContext *s)
>  av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
>  {
>      MJpegDecodeContext *s = avctx->priv_data;
> +    
> +    if (avctx->width > 65500 || avctx->height > 65500) {
> +        av_log(avctx, AV_LOG_ERROR, "JPEG does not support resolutions above 65500x65500\n");
> +        return -1;
> +    }

this wont work as the w/h can be set later

also iam not sure why we should reject jpegs that are larger


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120531/4a5cf30c/attachment.asc>


More information about the ffmpeg-devel mailing list