avcodec/h264: Only reinit quant tables if a new PPS is allowed
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 24 Feb 2015 19:49:07 +0000 (20:49 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 25 Feb 2015 02:42:31 +0000 (03:42 +0100)
Fixes null pointer dereference
Fixes: signal_sigsegv_3042097_3007_cov_1741463594_non_monotone_timestamps1.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c23a0e77dd492d6c794f89dbff3a438c95745e70)

Conflicts:

libavcodec/h264_slice.c

libavcodec/h264.c

index 262ea8a..4e10b93 100644 (file)
@@ -3616,7 +3616,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
         }
     }
 
-    if (h == h0 && h->dequant_coeff_pps != pps_id) {
+    if (first_slice && h->dequant_coeff_pps != pps_id) {
         h->dequant_coeff_pps = pps_id;
         init_dequant_tables(h);
     }