From bd686a637017d638b0aabac0b4b9ae39c6e2b247 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 30 Sep 2011 11:38:15 +0200 Subject: [PATCH] codecparsers: vc1: handle End-of-Sequence correctly. --- gst-libs/gst/codecparsers/gstvc1parser.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/codecparsers/gstvc1parser.c b/gst-libs/gst/codecparsers/gstvc1parser.c index 8b0b785672..043d484c20 100644 --- a/gst-libs/gst/codecparsers/gstvc1parser.c +++ b/gst-libs/gst/codecparsers/gstvc1parser.c @@ -1200,8 +1200,8 @@ gst_vc1_identify_next_bdu (const guint8 * data, gsize size, GstVC1BDU * bdu) ensure_debug_category (); - if (size <= 4) { - GST_DEBUG ("Can't parse, buffer is to small size %" G_GSSIZE_FORMAT, size); + if (size < 4) { + GST_DEBUG ("Can't parse, buffer has too small size %" G_GSSIZE_FORMAT, size); return GST_VC1_PARSER_ERROR; } @@ -1218,6 +1218,12 @@ gst_vc1_identify_next_bdu (const guint8 * data, gsize size, GstVC1BDU * bdu) bdu->data = (guint8 *) data; bdu->type = (GstVC1StartCode) (data[bdu->offset - 1]); + if (bdu->type == GST_VC1_END_OF_SEQ) { + GST_DEBUG ("End-of-Sequence BDU found"); + bdu->size = 0; + return GST_VC1_PARSER_OK; + } + off2 = scan_for_start_codes (data + bdu->offset, size - bdu->offset); if (off2 < 0) { GST_DEBUG ("Bdu start %d, No end found", bdu->offset);