[FFmpeg-cvslog] h264: do not call field_end if we do not have a current picture

Anton Khirnov git at videolan.org
Sat Jan 18 22:07:49 CET 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Nov 28 10:54:35 2013 +0100| [00dbff4c3e048b4abd01bf805725aabff0fa5ee1] | committer: Anton Khirnov

h264: do not call field_end if we do not have a current picture

Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00dbff4c3e048b4abd01bf805725aabff0fa5ee1
---

 libavcodec/h264.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 9817d20..ed5aea8 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3348,7 +3348,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
     first_mb_in_slice = get_ue_golomb(&h->gb);
 
     if (first_mb_in_slice == 0) { // FIXME better field boundary detection
-        if (h0->current_slice && FIELD_PICTURE(h)) {
+        if (h0->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
             field_end(h, 1);
         }
 



More information about the ffmpeg-cvslog mailing list