diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-12-28 22:22:57 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-12-31 02:37:08 +0100 |
commit | 283e751aefcea4fd84c471c9a076cc886803e0ef (patch) | |
tree | ef2356a41e2d9223aa4422025d1c29040606c5f0 /libavcodec/mjpegbdec.c | |
parent | 11a8d2ccab1fe165eef4578c048d38731dbe1d6f (diff) | |
download | ffmpeg-283e751aefcea4fd84c471c9a076cc886803e0ef.tar.gz |
avcodec/mjpegbdec: Propagate error codes
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mjpegbdec.c')
-rw-r--r-- | libavcodec/mjpegbdec.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index 8583fcb4f9..37d7bb8228 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -87,9 +87,9 @@ read_header: if (dqt_offs) { init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8); s->start_code = DQT; - if (ff_mjpeg_decode_dqt(s) < 0 && - (avctx->err_recognition & AV_EF_EXPLODE)) - return AVERROR_INVALIDDATA; + ret = ff_mjpeg_decode_dqt(s); + if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) + return ret; } dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size is %d\n"); @@ -105,8 +105,8 @@ read_header: if (sof_offs) { init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8); s->start_code = SOF0; - if (ff_mjpeg_decode_sof(s) < 0) - return -1; + if ((ret = ff_mjpeg_decode_sof(s)) < 0) + return ret; } sos_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sos is %d and size is %d\n"); @@ -118,9 +118,9 @@ read_header: 8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs)); s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16)); s->start_code = SOS; - if (ff_mjpeg_decode_sos(s, NULL, 0, NULL) < 0 && - (avctx->err_recognition & AV_EF_EXPLODE)) - return AVERROR_INVALIDDATA; + ret = ff_mjpeg_decode_sos(s, NULL, 0, NULL); + if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) + return ret; } if (s->interlaced) { |