Hi guys,

the idea of this patch is very simple, and has existed in Chrome in a
slightly different form for quite a while: for each call to get_bits() and
related functions, check for overreads before advancing the frame pointer.

This protects against overreads in most decoders except those that use
custom bitreaders, like VP8 (which already does this), CABAC (which I'll do
later) and a few more. Speed depends on how many bits are read per frame,
but ranges from a 1-10% loss on low to ultra-high bitrate CAVLC H264
streams, to unnoticeable losses of <0.1% on e.g. VC1 (because the DSP is
less optimized, so the bitreader overhead is relatively lower).

Design is that there's a configure option (currently default-off) to enable
the "safe" bitstream reader, and individual decoders that do bitstream
checks themselves can turn it off on a per-decoder basis.

Please comment.

Ronald

Attachment: 0001-get_bits-introduce-safe-bitreading-to-prevent-overre.patch
Description: Binary data

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to