Commit 283e751a authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mjpegbdec: Propagate error codes

Reviewed-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 11a8d2cc
...@@ -87,9 +87,9 @@ read_header: ...@@ -87,9 +87,9 @@ read_header:
if (dqt_offs) { if (dqt_offs) {
init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8); init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - (buf_ptr+dqt_offs))*8);
s->start_code = DQT; s->start_code = DQT;
if (ff_mjpeg_decode_dqt(s) < 0 && ret = ff_mjpeg_decode_dqt(s);
(avctx->err_recognition & AV_EF_EXPLODE)) if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA; return ret;
} }
dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size is %d\n"); dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size is %d\n");
...@@ -105,8 +105,8 @@ read_header: ...@@ -105,8 +105,8 @@ read_header:
if (sof_offs) { if (sof_offs) {
init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8); init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - (buf_ptr+sof_offs))*8);
s->start_code = SOF0; s->start_code = SOF0;
if (ff_mjpeg_decode_sof(s) < 0) if ((ret = ff_mjpeg_decode_sof(s)) < 0)
return -1; return ret;
} }
sos_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sos is %d and size is %d\n"); sos_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sos is %d and size is %d\n");
...@@ -118,9 +118,9 @@ read_header: ...@@ -118,9 +118,9 @@ read_header:
8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs)); 8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs));
s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16)); s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
s->start_code = SOS; s->start_code = SOS;
if (ff_mjpeg_decode_sos(s, NULL, 0, NULL) < 0 && ret = ff_mjpeg_decode_sos(s, NULL, 0, NULL);
(avctx->err_recognition & AV_EF_EXPLODE)) if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA; return ret;
} }
if (s->interlaced) { if (s->interlaced) {
......
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