aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-08 17:55:41 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-02-08 19:22:05 +0100
commit63637e457c4cc32b6e720206f48f6d354adda190 (patch)
tree8eecab3b3501ceeb54985644fbe3026204147a04 /libavcodec
parented2572b9c8f885e2a4764d2e34604442a71899a1 (diff)
downloadffmpeg-63637e457c4cc32b6e720206f48f6d354adda190.tar.gz
avcodec/h264_slice: Clear ref_counts on redundant slices
Fixes reading freed memory Fixes: 568/clusterfuzz-testcase-6107186067406848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c03029a835949fc0e68b4c6558ebcdc3ae137087) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_slice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 25a5890aa8..8aaa37043b 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1771,8 +1771,10 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl,
return ret;
// discard redundant pictures
- if (sl->redundant_pic_count > 0)
+ if (sl->redundant_pic_count > 0) {
+ sl->ref_count[0] = sl->ref_count[1] = 0;
return 0;
+ }
if (sl->first_mb_addr == 0 || !h->current_slice) {
if (h->setup_finished) {