[FFmpeg-devel] FLAC decoder and FF_INPUT_BUFFER_PADDING_SIZE

Michael Niedermayer michaelni at gmx.at
Fri Apr 10 03:39:57 CEST 2015

On Fri, Apr 10, 2015 at 04:27:54AM +0300, Ludmila Glinskih wrote:
> Hi!
> I tried to decode a FLAC file using the API and I noticed a strange
> thing: as I read in the documentation I should give
> avcodec_decode_audio4 a buffer with extra FF_INPUT_BUFFER_PADDING_SIZE
> bytes. If I don't initialize the extra bytes of the buffer, I get an
> error from valgrind: "Conditional jump or move depends on
> uninitialized value(s)". I understand that it might happen if input is
> corrupted. But is there another explanation? Or is my input is really
> corrupted......

it is possible that this is a limitation of valgrind, that is
get_bits reads 4bytes and these can cross over the end and into
but the bits that are used should just be from the initialized area
but valgrind likely fails to keep track of which bits of the 32bit
read are initialized and which not


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150410/ac11faa1/attachment.asc>

More information about the ffmpeg-devel mailing list