changeset 9910:d07aee233d03 libavcodec

H.264: Don't set data_partitioning for invalid NAL_DPA. Before, the decoder could interpret a corrupt frame as a NAL_DPA and NAL_DPC, and then start decoding even if decode_slice_header() returned an error. This frequently caused crashes. Fixes issue1228, issue1229, and partially issue1238.
author astrange
date Fri, 03 Jul 2009 05:52:00 +0000
parents 30dad2d5e7fe
children 14edbbff0f25
files h264.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Thu Jul 02 13:13:20 2009 +0000
+++ b/h264.c	Fri Jul 03 05:52:00 2009 +0000
@@ -7603,9 +7603,12 @@
             init_get_bits(&hx->s.gb, ptr, bit_length);
             hx->intra_gb_ptr=
             hx->inter_gb_ptr= NULL;
+
+            if ((err = decode_slice_header(hx, h)) < 0)
+                break;
+
             hx->s.data_partitioning = 1;
 
-            err = decode_slice_header(hx, h);
             break;
         case NAL_DPB:
             init_get_bits(&hx->intra_gb, ptr, bit_length);