summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-23 14:57:30 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-23 14:57:30 +0200
commit356031348c3b26aa9698e863d88bf87e8190bcc6 (patch)
tree6672b2f13bb6aee3de9a34a1e15bc2437d08a45e /libavcodec/vc1dec.c
parenta51f3b53fe7f96a15af4dd6fbdb9a084e89a4321 (diff)
avcodec/vc1dec: fix propagating error codes from various functions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r--libavcodec/vc1dec.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 1f090339a0..439d68eee9 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5581,6 +5581,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
GetBitContext gb;
+ int ret;
/* save the container output size for WMImage */
v->output_width = avctx->width;
@@ -5597,13 +5598,13 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
avctx->flags |= CODEC_FLAG_EMU_EDGE;
v->s.flags |= CODEC_FLAG_EMU_EDGE;
- if (ff_vc1_init_common(v) < 0)
- return -1;
+ if ((ret = ff_vc1_init_common(v)) < 0)
+ return ret;
// ensure static VLC tables are initialized
- if (ff_msmpeg4_decode_init(avctx) < 0)
- return -1;
- if (ff_vc1_decode_init_alloc_tables(v) < 0)
- return -1;
+ if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
+ return ret;
+ if ((ret = ff_vc1_decode_init_alloc_tables(v)) < 0)
+ return ret;
// Hack to ensure the above functions will be called
// again once we know all necessary settings.
// That this is necessary might indicate a bug.
@@ -5622,8 +5623,8 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
init_get_bits(&gb, avctx->extradata, avctx->extradata_size*8);
- if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0)
- return -1;
+ if ((ret = ff_vc1_decode_sequence_header(avctx, v, &gb)) < 0)
+ return ret;
count = avctx->extradata_size*8 - get_bits_count(&gb);
if (count > 0) {
@@ -5657,16 +5658,16 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
init_get_bits(&gb, buf2, buf2_size * 8);
switch (AV_RB32(start)) {
case VC1_CODE_SEQHDR:
- if (ff_vc1_decode_sequence_header(avctx, v, &gb) < 0) {
+ if ((ret = ff_vc1_decode_sequence_header(avctx, v, &gb)) < 0) {
av_free(buf2);
- return -1;
+ return ret;
}
seq_initialized = 1;
break;
case VC1_CODE_ENTRYPOINT:
- if (ff_vc1_decode_entry_point(avctx, v, &gb) < 0) {
+ if ((ret = ff_vc1_decode_entry_point(avctx, v, &gb)) < 0) {
av_free(buf2);
- return -1;
+ return ret;
}
ep_initialized = 1;
break;