From fb1217281093b73b7ab3d85f5cda494db5729f06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 4 Apr 2011 10:07:42 +0200 Subject: [PATCH] qtdemux: Check for invalid (empty) classification info entity strings Otherwise the classification string can be empty and gst_tag_list_add() will complain or have a \0 in the first four bytes, which is wrong too. --- gst/qtdemux/qtdemux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 63871a5a8..64a9d4456 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -7584,6 +7584,12 @@ qtdemux_tag_add_classification (GstQTDemux * qtdemux, const char *tag, offset = 12; entity = (guint8 *) node->data + offset; + if (entity[0] == 0 || entity[1] == 0 || entity[2] == 0 || entity[3] == 0) { + GST_DEBUG_OBJECT (qtdemux, + "classification info: %c%c%c%c invalid classification entity", + entity[0], entity[1], entity[2], entity[3]); + return; + } offset += 4; table = QT_UINT16 ((guint8 *) node->data + offset); -- 2.34.1