codecparsers: mpeg4: actually return full number of bits of resync marker

Switch the increment of markersize from when it is used to when it is
returned from compute_resync_marker_size.

This also makes the CHECK_REMAINING in gst_mpeg4_parse_video_packet_header
check for the actually required number of bits now and not one too few.

https://bugzilla.gnome.org/show_bug.cgi?id=739345
This commit is contained in:
Luis de Bethencourt 2014-10-29 15:03:04 +00:00 committed by Tim-Philipp Müller
parent b14fb383ed
commit 417db39d0d

View file

@ -347,7 +347,7 @@ compute_resync_marker_size (const GstMpeg4VideoObjectPlane * vop,
}
}
return off++; /* Take the following 1 into account */
return off + 1; /* Take the following 1 into account */
}
/**
@ -1641,7 +1641,7 @@ gst_mpeg4_parse_video_packet_header (GstMpeg4VideoPacketHdr * videopackethdr,
CHECK_REMAINING (&br, markersize);
if (gst_bit_reader_get_bits_uint32_unchecked (&br, markersize + 1) != 0x01)
if (gst_bit_reader_get_bits_uint32_unchecked (&br, markersize) != 0x01)
goto failed;
if (vol->shape != GST_MPEG4_RECTANGULAR) {