[FFmpeg-cvslog] Merge commit 'd909f43b5c773a73c8d526638744547ba4aa8c59'
Derek Buitenhuis
git at videolan.org
Sun Apr 17 20:32:52 CEST 2016
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Sun Apr 17 19:32:26 2016 +0100| [61400a1dc751c82cf6f33a7510c3804b7b201f25] | committer: Derek Buitenhuis
Merge commit 'd909f43b5c773a73c8d526638744547ba4aa8c59'
* commit 'd909f43b5c773a73c8d526638744547ba4aa8c59':
vc1dec: wmv2dec: Validate ff_intrax8_common_init return value
Merged-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=61400a1dc751c82cf6f33a7510c3804b7b201f25
---
libavcodec/vc1dec.c | 10 ++++++----
libavcodec/wmv2dec.c | 4 +---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 75d069d..dae697b 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -324,7 +324,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
{
MpegEncContext *s = &v->s;
- int i;
+ int i, ret = AVERROR(ENOMEM);
int mb_height = FFALIGN(s->mb_height, 2);
/* Allocate mb bitplanes */
@@ -381,19 +381,21 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v)
v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1;
v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
- ff_intrax8_common_init(&v->x8,s);
-
if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
for (i = 0; i < 4; i++)
if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width)))
return AVERROR(ENOMEM);
}
+ ret = ff_intrax8_common_init(&v->x8, s);
+ if (ret < 0)
+ goto error;
+
return 0;
error:
ff_vc1_decode_end(s->avctx);
- return AVERROR(ENOMEM);
+ return ret;
}
av_cold void ff_vc1_init_transposed_scantables(VC1Context *v)
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 0c2f14d..934bf15 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -466,9 +466,7 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
ff_wmv2_common_init(w);
- ff_intrax8_common_init(&w->x8, &w->s);
-
- return 0;
+ return ff_intrax8_common_init(&w->x8, &w->s);
}
static av_cold int wmv2_decode_end(AVCodecContext *avctx)
======================================================================
diff --cc libavcodec/vc1dec.c
index 75d069d,c67fffa..dae697b
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@@ -381,14 -371,18 +381,16 @@@ av_cold int ff_vc1_decode_init_alloc_ta
v->mv_f_next[0] = v->mv_f_next_base + s->b8_stride + 1;
v->mv_f_next[1] = v->mv_f_next[0] + (s->b8_stride * (mb_height * 2 + 1) + s->mb_stride * (mb_height + 1) * 2);
- ff_intrax8_common_init(&v->x8,s);
-
if (s->avctx->codec_id == AV_CODEC_ID_WMV3IMAGE || s->avctx->codec_id == AV_CODEC_ID_VC1IMAGE) {
- for (i = 0; i < 4; i++) {
- v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width);
- if (!v->sr_rows[i >> 1][i & 1])
- goto error;
- }
+ for (i = 0; i < 4; i++)
+ if (!(v->sr_rows[i >> 1][i & 1] = av_malloc(v->output_width)))
+ return AVERROR(ENOMEM);
}
+ ret = ff_intrax8_common_init(&v->x8, s);
+ if (ret < 0)
+ goto error;
+
return 0;
error:
More information about the ffmpeg-cvslog
mailing list