[FFmpeg-devel] [PATCH] avcodec/mpeg4_unpack_bframes_bsf: Improve DivX userdata check

Michael Niedermayer michael at niedermayer.cc
Tue Mar 12 00:26:34 EET 2019


On Mon, Mar 11, 2019 at 12:36:08PM +0100, Andreas Rheinhardt wrote:
> The earlier version didn't really check that the 'p' of a "p\0" is
> actually part of a user_data section, instead it treated the first
> "p\0" after the start of a user_data section as end of a user_data
> section if it is close enough to the beginning of the user_data section;
> it actually needn't be part of a user_data section at all.
> 
> Furthermore, the code worked under the assumption that there is a 0x00
> after the 'p' although this might not be true for extradata if the
> user_data unit is at the end of the extradata.
> 
> Both of these flaws have been fixed.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at googlemail.com>
> ---
> The earlier version was inspired by the check for packed bitstreams in
> decode_user_data() in mpeg4videodec.c where the "DivX" is mandatory,
> too.

> Note that this new version relies on there being no binary zero inside
> the user data.

Is this based on anything from the spec ?


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190311/7996422d/attachment.sig>


More information about the ffmpeg-devel mailing list