Also make sure not to reuse the same variable.
CC: [email protected]
Bug-Id: CID 1238840
---
>From the parsers batch, got left behind.
Vittorio
libavcodec/h263dec.c | 4 +++-
libavcodec/mpeg4video_parser.c | 12 ++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 31e014a..77eeb43 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -439,7 +439,9 @@ int ff_h263_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame,
s->avctx->extradata_size);
if (ret < 0)
return ret;
- ff_mpeg4_decode_picture_header(avctx->priv_data, &gb);
+ ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &gb);
+ if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+ return ret;
}
ret = ff_mpeg4_decode_picture_header(avctx->priv_data, &s->gb);
} else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) {
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index 246bb9c..16279c2 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -84,12 +84,20 @@ static int mpeg4_decode_header(AVCodecParserContext *s1,
AVCodecContext *avctx,
s->current_picture_ptr = &s->current_picture;
if (avctx->extradata_size && pc->first_picture) {
- init_get_bits(gb, avctx->extradata, avctx->extradata_size * 8);
+ ret = init_get_bits(gb, avctx->extradata, avctx->extradata_size * 8);
+ if (ret < 0)
+ return ret;
ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
+ if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+ return ret;
}
- init_get_bits(gb, buf, 8 * buf_size);
+ ret = init_get_bits(gb, buf, 8 * buf_size);
+ if (ret < 0)
+ return ret;
ret = ff_mpeg4_decode_picture_header(dec_ctx, gb);
+ if (ret < 0)
+ return ret;
if (s->width && (!avctx->width || !avctx->height ||
!avctx->coded_width || !avctx->coded_height)) {
ret = ff_set_dimensions(avctx, s->width, s->height);
--
1.9.3 (Apple Git-50)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel