[FFmpeg-devel] [PATCH 2/2] avcodec/g723_1enc: Avoid skip_put_bits()

Michael Niedermayer michael at niedermayer.cc
Fri Jul 31 22:38:22 EEST 2020


On Fri, Jul 31, 2020 at 12:39:46PM +0200, Andreas Rheinhardt wrote:
> If a bit is reserved, it matters very much what value it has, because
> otherwise a decoder conforming to a future version of the standard might
> interpret the output file in an unintended manner. This implies that
> one must not use skip_put_bits() for it (which does not give any
> guarantees wrt what ends up in the output (in case of a little-endian
> bitstream writer (as here) it writes a 0 bit)); given that the reference
> encoder as well as the earlier code write a zero bit at this place, the
> new code does, too.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
> The earlier code here was unaffected by any of the bugs of
> skip_put_bits, because this code uses a little-endian writer and
> the number of bits written so far was always even, so that skipping
> a single bit could be done in the buffer itself.
> 
>  libavcodec/g723_1enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM

thx

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

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200731/1af0eb16/attachment.sig>


More information about the ffmpeg-devel mailing list