summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-08-08 16:12:13 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2017-08-08 16:15:46 +0200
commit4e27245f2893c1d2fef95dca2400ebfc16a3d93c (patch)
tree50a0429b154ed63a1d7f4be8b8c831e0ded04664
parent067968ae74f321ae9927d43af8b9deab923d17ca (diff)
libs: decoder: mpeg4: fail if return value is not OK
Coverity scan bug: An assigned value that is never used may represent unnecessary computation, an incorrect algorithm, or possibly the need for cleanup or refactoring. In the return value of decode_slice() or gst_mpeg4_parse_video_packet_header() are not success, thus fail decode_packet() function.
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
index 314498f7..bda09b4d 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c
@@ -900,6 +900,8 @@ decode_packet (GstVaapiDecoderMpeg4 * decoder, GstMpeg4Packet packet)
if (first_slice) {
status = decode_slice (decoder, _data, video_packet.size, FALSE);
+ if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
+ return status;
first_slice = FALSE;
} else {
_data += video_packet.offset;
@@ -909,9 +911,13 @@ decode_packet (GstVaapiDecoderMpeg4 * decoder, GstMpeg4Packet packet)
gst_mpeg4_parse_video_packet_header (&priv->packet_hdr,
&priv->vol_hdr, &priv->vop_hdr, &priv->sprite_trajectory, _data,
_data_size);
+ if (ret != GST_MPEG4_PARSER_OK)
+ return GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER;
status =
decode_slice (decoder, _data + priv->packet_hdr.size / 8,
video_packet.size - priv->packet_hdr.size / 8, TRUE);
+ if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
+ return status;
}
_data += video_packet.size;