mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
mpeg4: improve error checking while decoding packets.
decode_picture() could return an error when an MPEG-4 profile is not supported for example. In this case, the underlying VA context is not allocated and no other proper action can be taken. Likewise on exit from decode_slice(). Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
75538bbc9b
commit
b33dd69300
1 changed files with 4 additions and 0 deletions
|
@ -753,6 +753,8 @@ decode_packet(GstVaapiDecoderMpeg4 *decoder, GstMpeg4Packet packet)
|
||||||
}
|
}
|
||||||
else if (tos->type == GST_MPEG4_VIDEO_OBJ_PLANE) {
|
else if (tos->type == GST_MPEG4_VIDEO_OBJ_PLANE) {
|
||||||
status = decode_picture(decoder, packet.data + packet.offset, packet.size);
|
status = decode_picture(decoder, packet.data + packet.offset, packet.size);
|
||||||
|
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||||
|
return status;
|
||||||
|
|
||||||
/* decode slice
|
/* decode slice
|
||||||
* A resync marker shall only be located immediately before a macroblock
|
* A resync marker shall only be located immediately before a macroblock
|
||||||
|
@ -769,6 +771,8 @@ decode_packet(GstVaapiDecoderMpeg4 *decoder, GstMpeg4Packet packet)
|
||||||
|
|
||||||
if (priv->vol_hdr.resync_marker_disable) {
|
if (priv->vol_hdr.resync_marker_disable) {
|
||||||
status = decode_slice(decoder, _data, _data_size, FALSE);
|
status = decode_slice(decoder, _data, _data_size, FALSE);
|
||||||
|
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// next start_code is required to determine the end of last slice
|
// next start_code is required to determine the end of last slice
|
||||||
|
|
Loading…
Reference in a new issue