aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mjpegdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-09-02 17:10:57 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-09-03 13:25:54 +0200
commitcef5bc0e6e2320d3903cf063d59cef83e91dbc3c (patch)
tree1547814be4f22267d642960443e6cf58fa2aa815 /libavcodec/mjpegdec.c
parent39f75645c801974bd6e325688f72d4626610f356 (diff)
downloadffmpeg-cef5bc0e6e2320d3903cf063d59cef83e91dbc3c.tar.gz
lavc/mjpegdec: Do not skip reading quantization tables.
They may contain 0xFFs, confusing the start code finding algorithm. Fixes ticket #5819.
Diffstat (limited to 'libavcodec/mjpegdec.c')
-rw-r--r--libavcodec/mjpegdec.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 633a8f02c0..0645a1d2ac 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2119,6 +2119,8 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ret = mjpeg_decode_com(s);
if (ret < 0)
return ret;
+ } else if (start_code == DQT) {
+ ff_mjpeg_decode_dqt(s);
}
ret = -1;
@@ -2151,9 +2153,6 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->restart_count = 0;
/* nothing to do on SOI */
break;
- case DQT:
- ff_mjpeg_decode_dqt(s);
- break;
case DHT:
if ((ret = ff_mjpeg_decode_dht(s)) < 0) {
av_log(avctx, AV_LOG_ERROR, "huffman table decode error\n");