aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
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 20:08:22 +0100
commit3295d22f3ab197ac872603b38da535d33b971708 (patch)
tree4d330cb88d151e18160e99dc6bfe8d873ca06e4f /libavcodec/h264.c
parentdc1e099bf281e69d162bde02bd87112bbcb1ab5c (diff)
downloadffmpeg-3295d22f3ab197ac872603b38da535d33b971708.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/h264.c')
-rw-r--r--libavcodec/h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index b979b15382..550a7fc15e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1591,7 +1591,9 @@ again:
#endif
} else
context_count++;
- }
+ } else
+ sl->ref_count[0] = sl->ref_count[1] = 0;
+ break;
break;
case NAL_DPA:
case NAL_DPB: