Commit 17035c8d authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

lavc/mjpegdec: Do not skip reading quantization tables.

They may contain 0xFFs, confusing the start code finding algorithm.

Fixes ticket #5819.
(cherry picked from commit cef5bc0e)

Conflicts:
	libavcodec/mjpegdec.c
parent 426b959e
...@@ -2104,6 +2104,9 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -2104,6 +2104,9 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/* Comment */ /* Comment */
else if (start_code == COM) else if (start_code == COM)
mjpeg_decode_com(s); mjpeg_decode_com(s);
else if (start_code == DQT) {
ff_mjpeg_decode_dqt(s);
}
ret = -1; ret = -1;
...@@ -2135,9 +2138,6 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ...@@ -2135,9 +2138,6 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
s->restart_count = 0; s->restart_count = 0;
/* nothing to do on SOI */ /* nothing to do on SOI */
break; break;
case DQT:
ff_mjpeg_decode_dqt(s);
break;
case DHT: case DHT:
if ((ret = ff_mjpeg_decode_dht(s)) < 0) { if ((ret = ff_mjpeg_decode_dht(s)) < 0) {
av_log(avctx, AV_LOG_ERROR, "huffman table decode error\n"); av_log(avctx, AV_LOG_ERROR, "huffman table decode error\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment