[FFmpeg-devel] [PATCH 1/2] vc2enc: prevent random data
christophe.gisquet at gmail.com
Tue May 3 20:16:57 CEST 2016
2016-05-03 19:24 GMT+02:00 Hendrik Leppkes <h.leppkes at gmail.com>:
>> + // The reference decoder ignores it, and its typical length is 0
>> + memset(put_bits_ptr(pb), 0, s->prefix_bytes);
>> skip_put_bytes(pb, s->prefix_bytes);
> I don't suppose we have a function to just write zero bytes instead of
> these shenangans of written to the buffer and skiping?
I don't think so, but I may be wrong. The AV_ZERO macros are of course
not suited here.
>> + memset(pb->buf_ptr, 0, pad_c);
>> skip_put_bytes(pb, pad_c);
> Both occurances use different ways to access the buffer, once
> put_bits_ptr(pb) and one pb->buf_ptr, if this is the only way to do
> this, maybe stick to one?
Yeah, squashing issue. My next patch must have crossed your mail.
I thought of having another put_bits function like
put_byte_something(PutBitContext, uint8_t byte, unsigned int len).
But probably overkill.
Btw, afaik, the padding is 0xFF, so expecting 0 in the buffer there
can't do the job.
More information about the ffmpeg-devel