diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-11-20 22:14:37 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-11-20 22:14:37 +0000 |
commit | 98c82d691089214251283a1c16808c10f0744ca1 (patch) | |
tree | 5d9466835c8e9ca9e2b591b3305ad1f50cdc38bb /libavcodec/utils.c | |
parent | 9fe08942102ecd2dda0d6751b3c7d9f736cc4ee3 (diff) | |
download | ffmpeg-98c82d691089214251283a1c16808c10f0744ca1.tar.gz |
Allocate pictures with enough padding for jpeg.
Ensure that jpeg does not use mbs that could require larger padding.
This might have been exploitable.
Originally committed as revision 20566 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 6be9d724ae..810aa5d138 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -126,17 +126,19 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){ case PIX_FMT_YUYV422: case PIX_FMT_UYVY422: case PIX_FMT_YUV422P: + case PIX_FMT_YUV440P: case PIX_FMT_YUV444P: case PIX_FMT_GRAY8: case PIX_FMT_GRAY16BE: case PIX_FMT_GRAY16LE: case PIX_FMT_YUVJ420P: case PIX_FMT_YUVJ422P: + case PIX_FMT_YUVJ440P: case PIX_FMT_YUVJ444P: case PIX_FMT_YUVA420P: w_align= 16; //FIXME check for non mpeg style codecs and use less alignment h_align= 16; - if(s->codec_id == CODEC_ID_MPEG2VIDEO) + if(s->codec_id == CODEC_ID_MPEG2VIDEO || s->codec_id == CODEC_ID_MJPEG || s->codec_id == CODEC_ID_AMV || s->codec_id == CODEC_ID_THP) h_align= 32; // interlaced is rounded up to 2 MBs break; case PIX_FMT_YUV411P: |