[FFmpeg-devel] [PATCH] Revert removal of bytestream end checks in cabac decoder.

Michael Niedermayer michaelni at gmx.at
Sat Sep 10 20:05:09 CEST 2011


On Sat, Sep 10, 2011 at 01:10:52AM +0200, Laurent Aimar wrote:
>  I don't think that preventing overread in the cabac reader can be implemented
> without checking the boundary when refilling the state (at least with the
> current way of handling FF_INPUT_PADDING_SIZE).
>  See patch attached.

I do think it can be prevented without changing the cabac reader.
a patch doing so is attached, i will push it later today or tomorrow
unless there are objections
The advantage of my variant is also, its trivial to add support to
disable it at runtime and thus prevent the tiny performance hit.

someone (jason/loren ?) also might want to set MAX_MBPAIR_SIZE to a
tigher limit. my limit is way larger than needed.
Also the buffer memset(0) should force the cabac reader into reading
MPS and this bounds the worst case bit per symbol tightly.


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There seems to be only one solution to NIH syndrom, ... a shooting squad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-h264dec-Prevent-CABAC-and-CAVLC-bitsteram-overreadin.patch
Type: text/x-patch
Size: 2090 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110910/cf0041dc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110910/cf0041dc/attachment.asc>

More information about the ffmpeg-devel mailing list