summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Halley <halley.zhao@intel.com>2013-01-09 05:40:46 +0800
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-01-25 11:23:24 +0100
commit6ec3d9d8fee2141a0d1c21f001089b390f8bc51a (patch)
tree6bbd2562cb2bf4d18d4983b0aed5bacd7bd79eb1
parent0e2d95f948c1eb0e1ee12da7fda9705405044bd6 (diff)
downloadgst-vaapi-6ec3d9d8fee2141a0d1c21f001089b390f8bc51a.tar.gz
h264: reset got_{sps,pps} when corrupted SPS/PPS headers are parsed.
Reset got_{sps,pps} when corrupted SPS/PPS headers are parsed. This means that no frame will be decoded until valid SPS/PPS headers are parsed again. This also prevents from parsing slice headers with invalid data, and avoids potential crashes. https://bugs.freedesktop.org/show_bug.cgi?id=57902
-rwxr-xr-x[-rw-r--r--]gst-libs/gst/vaapi/gstvaapidecoder_h264.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
index 3f8bb844..78b093d1 100644..100755
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
@@ -1175,8 +1175,10 @@ decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu)
memset(sps, 0, sizeof(*sps));
result = gst_h264_parser_parse_sps(priv->parser, nalu, sps, TRUE);
- if (result != GST_H264_PARSER_OK)
+ if (result != GST_H264_PARSER_OK) {
+ priv->got_sps = FALSE;
return get_status(result);
+ }
priv->got_sps = TRUE;
return GST_VAAPI_DECODER_STATUS_SUCCESS;
@@ -1193,8 +1195,10 @@ decode_pps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu)
memset(pps, 0, sizeof(*pps));
result = gst_h264_parser_parse_pps(priv->parser, nalu, pps);
- if (result != GST_H264_PARSER_OK)
+ if (result != GST_H264_PARSER_OK) {
+ priv->got_pps = FALSE;
return get_status(result);
+ }
priv->got_pps = TRUE;
return GST_VAAPI_DECODER_STATUS_SUCCESS;