h264: fix detection of optional trailing PPS elements
authorMans Rullgard <mans@mansr.com>
Mon, 10 Oct 2011 23:58:03 +0000 (00:58 +0100)
committerMans Rullgard <mans@mansr.com>
Tue, 11 Oct 2011 11:05:51 +0000 (12:05 +0100)
commitbe1242a3f2b28e9cb08515bdc1db6c14403c279a
tree4a97227174cc0917040633301f51da7d8fb4d498
parentc79d2a20bad59298188171f1316a830d563a41ee
h264: fix detection of optional trailing PPS elements

The PPS may contain a few trailing elements whose presence is
only signalled by data remaining after the the mandatory part
has been parsed.  The current code fails to take into account
the rbsp_trailing_bits() when deciding whether to parse these
optional elements.  Assuming no unnecessary padding bytes are
passed to this function, the optional elements are present if
either more than 8 extra bits remain or the remaining bits do
not form a valid rbsp_trailing_bits() after the mandatory PPS
elements have been parsed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/h264_ps.c