decoder: h264: fix uninitialized variables in avcC mode.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 2 Jun 2015 09:46:00 +0000 (11:46 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 2 Jun 2015 09:50:56 +0000 (11:50 +0200)
Fix uninitialized variables when decoding SPS and PPS NAL units from
"codec-data" buffers. This is particularly important when seeking ops
are involved, and the new persistent states are used more often.

https://bugzilla.gnome.org/show_bug.cgi?id=750094

gst-libs/gst/vaapi/gstvaapidecoder_h264.c

index 20d96ceec0cae03a8d470c06656a96d79bfd3228..677e73b7acecc5a2610614f506e598ce191a3c08 100644 (file)
@@ -4285,6 +4285,9 @@ gst_vaapi_decoder_h264_decode_codec_data(GstVaapiDecoder *base_decoder,
             goto cleanup;
         ofs = pi->nalu.offset + pi->nalu.size;
 
             goto cleanup;
         ofs = pi->nalu.offset + pi->nalu.size;
 
+        pi->state = priv->parser_state;
+        pi->flags = 0;
+
         status = decode_sps(decoder, &unit);
         if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
             goto cleanup;
         status = decode_sps(decoder, &unit);
         if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
             goto cleanup;
@@ -4315,6 +4318,9 @@ gst_vaapi_decoder_h264_decode_codec_data(GstVaapiDecoder *base_decoder,
             goto cleanup;
         ofs = pi->nalu.offset + pi->nalu.size;
 
             goto cleanup;
         ofs = pi->nalu.offset + pi->nalu.size;
 
+        pi->state = priv->parser_state;
+        pi->flags = 0;
+
         status = decode_pps(decoder, &unit);
         if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
             goto cleanup;
         status = decode_pps(decoder, &unit);
         if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
             goto cleanup;