summaryrefslogtreecommitdiffstats
path: root/gst/h264parse/gsth264parse.c
diff options
context:
space:
mode:
authorDave Robillard <dave@drobilla.net>2009-06-22 17:04:00 -0400
committerDave Robillard <dave@drobilla.net>2009-06-22 17:04:00 -0400
commit218878de5ea48b5acdf36070a73a50fd71f41741 (patch)
tree12384ce50f1af7eb61c2c18a0d6141595797bc53 /gst/h264parse/gsth264parse.c
parent925e83ee60c5406b2e5f0f39b0da0f90370efc27 (diff)
parenta2a0322df9a7005a01aafb5efc32fcc1179d205c (diff)
downloadgst-plugins-bad-218878de5ea48b5acdf36070a73a50fd71f41741.tar.gz
gst-plugins-bad-218878de5ea48b5acdf36070a73a50fd71f41741.tar.bz2
gst-plugins-bad-218878de5ea48b5acdf36070a73a50fd71f41741.zip
Merge branch 'master' of git://anongit.freedesktop.org/gstreamer/gst-plugins-bad into fdo
Conflicts: ext/ladspa/Makefile.am ext/ladspa/gstladspa.h ext/lv2/Makefile.am ext/lv2/gstlv2.h
Diffstat (limited to 'gst/h264parse/gsth264parse.c')
-rw-r--r--gst/h264parse/gsth264parse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c
index bea4a600..ebc4360d 100644
--- a/gst/h264parse/gsth264parse.c
+++ b/gst/h264parse/gsth264parse.c
@@ -464,6 +464,16 @@ gst_h264_parse_chain_forward (GstH264Parse * h264parse, gboolean discont,
for (i = 0; i < h264parse->nal_length_size; i++)
nalu_size = (nalu_size << 8) | data[i];
+ GST_LOG_OBJECT (h264parse, "got NALU size %u", nalu_size);
+
+ /* check for invalid NALU sizes, assume the size if the available bytes
+ * when something is fishy */
+ if (nalu_size <= 1 || nalu_size + h264parse->nal_length_size > avail) {
+ nalu_size = avail - h264parse->nal_length_size;
+ GST_DEBUG_OBJECT (h264parse, "fixing invalid NALU size to %u",
+ nalu_size);
+ }
+
/* Packetized format, see if we have to split it, usually splitting is not
* a good idea as decoders have no way of handling it. */
if (h264parse->split_packetized) {