aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-16 23:23:09 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-16 23:23:09 +0100
commita26bfc444d256585a9c084cc89ac0f983241755a (patch)
treec0f251fbef5fb29db2aaaa182f5ca24c1f71890c
parent93e3ec451caf12ebb22fbf3ecdb7bba41f7835c6 (diff)
parent48d57650f121d3d9e977832e9006bb334337d921 (diff)
downloadffmpeg-a26bfc444d256585a9c084cc89ac0f983241755a.tar.gz
Merge commit '48d57650f121d3d9e977832e9006bb334337d921' into release/0.10
* commit '48d57650f121d3d9e977832e9006bb334337d921': pthread: Fix deadlock during thread initialization mpegvideo: Initialize chroma_*_shift and codec_tag even if the size is 0 vc1dec: Don't decode slices when the latest slice header failed to decode Conflicts: libavcodec/mpegvideo.c libavcodec/pthread.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vc1dec.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index d94cd77899..5f745ad24e 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5582,6 +5582,8 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (avctx->hwaccel->end_frame(avctx) < 0)
goto err;
} else {
+ int header_ret = 0;
+
ff_er_frame_start(s);
v->bits = buf_size * 8;
@@ -5626,13 +5628,21 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
}
if (i) {
v->pic_header_flag = 0;
- if (v->field_mode && i == n_slices1 + 2)
- vc1_parse_frame_header_adv(v, &s->gb);
- else if (get_bits1(&s->gb)) {
+ if (v->field_mode && i == n_slices1 + 2) {
+ if ((header_ret = vc1_parse_frame_header_adv(v, &s->gb)) < 0) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Field header damaged\n");
+ continue;
+ }
+ } else if (get_bits1(&s->gb)) {
v->pic_header_flag = 1;
- vc1_parse_frame_header_adv(v, &s->gb);
+ if ((header_ret = vc1_parse_frame_header_adv(v, &s->gb)) < 0) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Slice header damaged\n");
+ continue;
+ }
}
}
+ if (header_ret < 0)
+ continue;
s->start_mb_y = (i == 0) ? 0 : FFMAX(0, slices[i-1].mby_start % mb_height);
if (!v->field_mode || v->second_field)
s->end_mb_y = (i == n_slices ) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);