diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-03 00:35:58 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-03 00:35:58 +0400 |
commit | a3f5ee297a7cf9bf21646ec4858d614f36248ff7 (patch) | |
tree | 1677a73aa89659fbe27a31a1d2d17320c0296646 /libavcodec/mjpegdec.c | |
parent | 0af48e29f55a4e5824e6f7157ac94cf8b210aa84 (diff) |
mjpeg: Check for interlaced progressive frames
Fixes null pointer dereference.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r-- | libavcodec/mjpegdec.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index dac0d6711d..0a9d03061f 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -312,8 +312,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) s->first_picture = 0; } - if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) + if (s->interlaced && (s->bottom_field == !s->interlace_polarity)) { + if (s->progressive) { + av_log_ask_for_sample(s->avctx, "progressively coded interlaced pictures not supported\n"); + return AVERROR_INVALIDDATA; + } return 0; + } /* XXX: not complete test ! */ pix_fmt_id = (s->h_count[0] << 28) | (s->v_count[0] << 24) | |