[FFmpeg-cvslog] avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
Michael Niedermayer
git at videolan.org
Thu Nov 26 17:55:10 CET 2015
ffmpeg | branch: release/2.5 | Michael Niedermayer <michael at niedermayer.cc> | Tue Nov 24 22:12:37 2015 +0100| [9ba0cb7c270385ec844d8ab0dcbc359d35174413] | committer: Michael Niedermayer
avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
Fixes out of array access
Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2049_f2192b6829ab6e0eefcb035329c03c60.264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 4ea4d2f438c9a7eba37980c9a87be4b34943e4d5)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ba0cb7c270385ec844d8ab0dcbc359d35174413
---
libavcodec/h264_slice.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 425de8d..5de2fcd 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1208,6 +1208,7 @@ static int h264_slice_header_init(H264Context *h, int reinit)
nb_slices = max_slices;
}
h->slice_context_count = nb_slices;
+ h->max_contexts = FFMIN(h->max_contexts, nb_slices);
if (!HAVE_THREADS || !(h->avctx->active_thread_type & FF_THREAD_SLICE)) {
ret = ff_h264_context_init(h);
More information about the ffmpeg-cvslog
mailing list