]> git.sesse.net Git - ffmpeg/commitdiff
h264: do not mess up cur_chroma_format_idc during thread update
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 16 Jan 2013 03:46:20 +0000 (04:46 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 16 Jan 2013 04:15:40 +0000 (05:15 +0100)
Fixes out of array reads
Regression probably since allowing pixel format changes or a related commit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264.c

index d5f4760b0c21be7cf8011fbc82a01a44303b12c4..3dcf00a357365ae033782a2269b4da02fa6e37b7 100644 (file)
@@ -1224,6 +1224,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
         /* copy block_offset since frame_start may not be called */
         memcpy(h->block_offset, h1->block_offset, sizeof(h->block_offset));
         h264_set_parameter_from_sps(h);
+        h->cur_chroma_format_idc = h1->cur_chroma_format_idc;
     }
 
     err = ff_mpeg_update_thread_context(dst, src);