summaryrefslogtreecommitdiff
path: root/libavcodec/wmv2dec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-09 16:36:16 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-10 18:49:35 +0200
commit0a06f5aca5edf04c94860381e7ef9d65b9dab193 (patch)
treeb91c7cde425322e0c08ab3bfedb99d21a54d2cbe /libavcodec/wmv2dec.c
parent193c40259e9ed9233256f1a3080b70c3e5bc609a (diff)
downloadffmpeg-0a06f5aca5edf04c94860381e7ef9d65b9dab193.tar.gz
avcodec/wmv2dec: Zero mb_type array for I pictures
Up until now, ff_wmv2_decode_secondary_picture_header() only set the mb_type array for non I-pictures, so that the decoding process uses the earlier values of this array; this affects the output of the wmv8-x8intra FATE-test (which this patch therefore updates). These earlier values were set when decoding earlier frames or when the buffer was initially zero-allocated. A consequence of this is that the output of this test would be random if ff_find_unused_picture() would select the unused picture to return at random. Furthermore decoding from a keyframe onwards depends upon the earlier state of the decoder. This patch therefore zeroes said array when decoding an I picture. (It is not claimed that zero is the right value to fill the array with. I just don't know.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/wmv2dec.c')
-rw-r--r--libavcodec/wmv2dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 6d9b72d123..22eb012f56 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -242,6 +242,10 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
WMV2DecContext *const w = (WMV2DecContext *) s;
if (s->pict_type == AV_PICTURE_TYPE_I) {
+ /* Is filling with zeroes really the right thing to do? */
+ memset(s->current_picture_ptr->mb_type, 0,
+ sizeof(*s->current_picture_ptr->mb_type) *
+ s->mb_height * s->mb_stride);
if (w->j_type_bit)
w->j_type = get_bits1(&s->gb);
else