[FFmpeg-devel] [PATCH] avcodec/put_bits: fix off be one

Hendrik Leppkes h.leppkes at gmail.com
Sun Jan 24 18:01:55 CET 2016


On Sun, Jan 24, 2016 at 5:51 PM, Paul B Mahol <onemda at gmail.com> wrote:
> On 1/24/16, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> Hi,
>>
>> On Sun, Jan 24, 2016 at 11:41 AM, Paul B Mahol <onemda at gmail.com> wrote:
>>
>>> patch attached.
>>
>>
>> I think that's wrong. buf_end is buf_start+size, so if size=1, this allows
>> writing up to and including buf_start[1], which overflows size=1.
>
> Assert happens otherwise when encoding flac.

I agree with Ronald, the check appears to be correct, buf_end points
to the first byte *after* the valid buffer.
Something else must be up in the flac encoder, maybe its buffer is a
bit too small?

- Hendrik


More information about the ffmpeg-devel mailing list