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
This commit is contained in:
Edward Hervey 2015-06-10 10:36:21 +02:00 committed by Edward Hervey
parent 29c79d7595
commit 898b436219

View file

@ -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)