[FFmpeg-devel] get_bits overrun checking from Google Chrome patches

Reimar Döffinger Reimar.Doeffinger
Tue Sep 8 10:29:01 CEST 2009


On Tue, Sep 08, 2009 at 01:29:27AM +0100, Robert Swain wrote:
> I'm actually a little surprised we didn't spot and remedy this
> earlier. Any suggestions for any cleaner solutions than Google's
> proposition?

Note that it would be acceptable to add a
get_bits_checked(GetBitContext *s, int bits, int fallback_value)
which checks for buffer end and returns fallback_value in that case,
but
a) It should come with a big fat warning that it is slow and
_unacceptable_ in any code where it is performance-relevant
b) It should check properly, bit-exact.



More information about the ffmpeg-devel mailing list