From 898b43621982175baba86fd02eadccf3af6c1091 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 10 Jun 2015 10:36:21 +0200 Subject: [PATCH] h263parse: Fix PSC matching We were off by one byte in the matching It should be (using 24 bit matching): * startcode : 0000 0000 0000 0000 1000 00xx * mask (bin) : 1111 1111 1111 1111 1111 1100 * mask (hex) : f f f f f c * match : 0 0 0 0 8 0 https://bugzilla.gnome.org/show_bug.cgi?id=750685 --- gst/videoparsers/gsth263parse.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst/videoparsers/gsth263parse.c b/gst/videoparsers/gsth263parse.c index 54932118d7..454e84b5de 100644 --- a/gst/videoparsers/gsth263parse.c +++ b/gst/videoparsers/gsth263parse.c @@ -169,10 +169,15 @@ find_psc (GstBuffer * buffer, guint skip) if (gst_byte_reader_peek_uint24_be (&br, &psc) == FALSE) goto out; - /* Scan for the picture start code (22 bits - 0x0020) */ + /* Scan for the picture start code (22 bits - 0x0020) + * startcode : 0000 0000 0000 0000 1000 00xx + * mask (bin) : 1111 1111 1111 1111 1111 1100 + * mask (hex) : f f f f f c + * match : 0 0 0 0 8 0 + */ while ((gst_byte_reader_get_remaining (&br) >= 3)) { if (gst_byte_reader_peek_uint24_be (&br, &psc) && - ((psc & 0xffffc0) == 0x000080)) { + ((psc & 0xfffffc) == 0x000080)) { psc_pos = gst_byte_reader_get_pos (&br); break; } else if (gst_byte_reader_skip (&br, 1) == FALSE)