diff options
author | Jan Schmidt <jan@centricular.com> | 2013-11-20 12:46:23 +1100 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2013-11-21 02:21:01 +1100 |
commit | c336f7642cd83a4521a91198e6c9ccee05c84f1d (patch) | |
tree | 503b395b27623b7d4fd32934ccac56dbcd2e13df /gst/dvdspu | |
parent | b58ca88fb9c3c3e1efd5a19c0c339cbe56987655 (diff) | |
download | gstreamer-plugins-bad-c336f7642cd83a4521a91198e6c9ccee05c84f1d.tar.gz |
dvdspu: Handle vobsub packets smaller than 4 bytes
In particular, handle the case of an empty packet with size 0 bytes.
Partially fixes: #712643
Diffstat (limited to 'gst/dvdspu')
-rw-r--r-- | gst/dvdspu/gstdvdspu.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/dvdspu/gstdvdspu.c b/gst/dvdspu/gstdvdspu.c index 8533935a3..e0edbec14 100644 --- a/gst/dvdspu/gstdvdspu.c +++ b/gst/dvdspu/gstdvdspu.c @@ -950,7 +950,7 @@ gst_dvd_spu_subpic_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) switch (dvdspu->spu_input_type) { case SPU_INPUT_TYPE_VOBSUB: - if (size > 4) { + if (size >= 2) { guint8 header[2]; guint16 packet_size; @@ -959,6 +959,10 @@ gst_dvd_spu_subpic_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) if (packet_size == size) { submit_new_spu_packet (dvdspu, dvdspu->partial_spu); dvdspu->partial_spu = NULL; + } else if (packet_size == 0) { + GST_LOG_OBJECT (dvdspu, "Discarding empty SPU buffer"); + gst_buffer_unref (dvdspu->partial_spu); + dvdspu->partial_spu = NULL; } else if (packet_size < size) { /* Somehow we collected too much - something is wrong. Drop the * packet entirely and wait for a new one */ |