Prevents using GetBitContexts with data from previous calls.

Fixes access to freed memory.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:[email protected]
---
 libavcodec/h264.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d43b11e..ad73bb3 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4899,6 +4899,9 @@ static int h264_decode_frame(AVCodecContext *avctx, void 
*data,
     int ret;
 
     h->flags = avctx->flags;
+    /* reset data partitioning here, to ensure GetBitContexts from previous
+     * packets do not get used. */
+    h->data_partitioning = 0;
 
     /* end of stream, output what is still in the buffers */
 out:
-- 
1.7.10.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to