tsdemux: Properly error out on jp2k parsing errors

Avoids crashes later on where we assume buffer exists
This commit is contained in:
Edward Hervey 2017-08-29 10:37:11 +02:00 committed by Edward Hervey
parent 63c582d685
commit 62d6f5c78a

View file

@ -2842,6 +2842,10 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
}
} else if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K) {
buffer = parse_jp2k_access_unit (stream);
if (!buffer) {
res = GST_FLOW_ERROR;
goto beach;
}
} else {
buffer = gst_buffer_new_wrapped (stream->data, stream->current_size);
}
@ -2878,6 +2882,10 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
}
} else if (bs->stream_type == GST_MPEGTS_STREAM_TYPE_VIDEO_JP2K) {
buffer = parse_jp2k_access_unit (stream);
if (!buffer) {
res = GST_FLOW_ERROR;
goto beach;
}
} else {
buffer = gst_buffer_new_wrapped (stream->data, stream->current_size);
}