h264parser: fix access to uninitialized memory

When vui->timing_info_present is 0, vui->fixed_frame_rate_flag and others
cannot be accessed since they have not been set.

It was also possible that sps->fps_{num,den} end up initialized here.
This commit is contained in:
René Stadler 2011-11-01 15:08:26 +01:00
parent 8f1a67896b
commit fd4eb2e220

View file

@ -1468,7 +1468,10 @@ gst_h264_parse_sps (GstH264NalUnit * nalu, GstH264SPS * sps,
sps->width = width;
sps->height = height;
if (vui) {
sps->fps_num = 0;
sps->fps_den = 1;
if (vui && vui->timing_info_present_flag) {
/* derive framerate */
/* FIXME verify / also handle other cases */
GST_LOG ("Framerate: %u %u %u %u", parse_vui_params,
@ -1484,8 +1487,6 @@ gst_h264_parse_sps (GstH264NalUnit * nalu, GstH264SPS * sps,
GST_LOG ("framerate %d/%d", sps->fps_num, sps->fps_den);
}
} else {
sps->fps_num = 0;
sps->fps_den = 1;
GST_LOG ("No VUI, unknown framerate");
}