[FFmpeg-cvslog] avcodec/mjpegbdec: Propagate error codes
Michael Niedermayer
git at videolan.org
Mon Dec 31 03:37:51 EET 2018
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Dec 28 22:22:57 2018 +0100| [283e751aefcea4fd84c471c9a076cc886803e0ef] | committer: Michael Niedermayer
avcodec/mjpegbdec: Propagate error codes
Reviewed-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=283e751aefcea4fd84c471c9a076cc886803e0ef
---
libavcodec/mjpegbdec.c | 16 ++++++++--------
1 file 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) {
More information about the ffmpeg-cvslog
mailing list