avcodec/hevc_sei: Fix null dereference in decode_pic_timing()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Nov 2013 00:53:19 +0000 (01:53 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 3 Nov 2013 01:19:28 +0000 (02:19 +0100)
Fixes Ticket3106

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/hevc_sei.c

index a6a5dfc..1770eb5 100644 (file)
@@ -78,10 +78,11 @@ static void decode_nal_sei_frame_packing_arrangement(HEVCContext *s)
 static int decode_pic_timing(HEVCContext *s)
 {
     GetBitContext *gb = &s->HEVClc->gb;
-    HEVCSPS *sps = (HEVCSPS*)s->sps_list[s->active_seq_parameter_set_id]->data;
+    HEVCSPS *sps;
 
-    if (!sps)
+    if (!s->sps_list[s->active_seq_parameter_set_id])
         return(AVERROR(ENOMEM));
+    sps = (HEVCSPS*)s->sps_list[s->active_seq_parameter_set_id]->data;
 
     if (sps->vui.frame_field_info_present_flag) {
         int pic_struct = get_bits(gb, 4);