mirror of https://git.ffmpeg.org/ffmpeg.git
mjpeg: treat external huffman table setup failure as codec init failure if external huffman table use requested
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
7485e54708
commit
a18e04bcf9
|
@ -101,8 +101,8 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
|
||||||
av_log(avctx, AV_LOG_INFO, "mjpeg: using external huffman table\n");
|
av_log(avctx, AV_LOG_INFO, "mjpeg: using external huffman table\n");
|
||||||
init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size*8);
|
init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size*8);
|
||||||
if (ff_mjpeg_decode_dht(s)) {
|
if (ff_mjpeg_decode_dht(s)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "mjpeg: error using external huffman table, switching back to internal\n");
|
av_log(avctx, AV_LOG_ERROR, "mjpeg: error using external huffman table\n");
|
||||||
build_basic_mjpeg_vlc(s);
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (avctx->extradata_size > 9 &&
|
if (avctx->extradata_size > 9 &&
|
||||||
|
|
|
@ -47,9 +47,7 @@ static av_cold int mxpeg_decode_init(AVCodecContext *avctx)
|
||||||
|
|
||||||
s->picture[0].reference = s->picture[1].reference = 3;
|
s->picture[0].reference = s->picture[1].reference = 3;
|
||||||
s->jpg.picture_ptr = &s->picture[0];
|
s->jpg.picture_ptr = &s->picture[0];
|
||||||
ff_mjpeg_decode_init(avctx);
|
return ff_mjpeg_decode_init(avctx);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mxpeg_decode_app(MXpegDecodeContext *s,
|
static int mxpeg_decode_app(MXpegDecodeContext *s,
|
||||||
|
|
Loading…
Reference in New Issue