diff options
author | Edward Hervey <edward@centricular.com> | 2017-08-29 10:37:11 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-08-29 10:37:11 +0200 |
commit | 62d6f5c78af0bc0b010de224f3a569dfd85c216d (patch) | |
tree | b30726db7e80dae83b53dff0b5c540f4db73f202 /gst | |
parent | 63c582d6853596c86b14a7e7038c6c102ec069ab (diff) |
tsdemux: Properly error out on jp2k parsing errors
Avoids crashes later on where we assume buffer exists
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegtsdemux/tsdemux.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index a570a1c6a..f802ae0ff 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -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); } |