From e9aaf9f1fb33de4222ae1eb35d28789f03a0ed2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Thu, 29 Jul 2010 23:26:59 +0200 Subject: Fix NULL pointer access when starting decoding anywhere in the stream. The referenced last_vcl_nal exists only when decoding starts at an IDR frame. Starting anywhere else may lead to a NULL pointer access. --- src/video_dec/libvdpau/h264_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/video_dec/libvdpau/h264_parser.c b/src/video_dec/libvdpau/h264_parser.c index 4794b5b9e..81621f070 100644 --- a/src/video_dec/libvdpau/h264_parser.c +++ b/src/video_dec/libvdpau/h264_parser.c @@ -375,7 +375,7 @@ void calculate_pic_order(struct h264_parser *parser, struct coded_picture *pic, pic->top_field_order_cnt = parser->prev_top_field_order_cnt; } else if (sps->pic_order_cnt_type == 2) { - uint32_t prev_frame_num = parser->last_vcl_nal->slc.frame_num; + uint32_t prev_frame_num = parser->last_vcl_nal ? parser->last_vcl_nal->slc.frame_num : 0; uint32_t prev_frame_num_offset = parser->frame_num_offset; uint32_t temp_pic_order_cnt = 0; -- cgit v1.2.3