[FFmpeg-trac] #5176(avcodec:new): avcodec_decode_video2 requiring input buffer to be larger than actual read bytes
FFmpeg
trac at avcodec.org
Thu Jan 21 12:09:35 CET 2016
#5176: avcodec_decode_video2 requiring input buffer to be larger than actual read
bytes
-------------------------------------+-------------------------------------
Reporter: hbos | Type:
Status: new | enhancement
Component: avcodec | Priority: normal
Keywords: | Version:
avcodec_decode_video2 | unspecified
AV_INPUT_BUFFER_PADDING_SIZE | Blocked By:
input buffer bitstream reader 32 | Reproduced by developer: 0
64 bits overread |
Blocking: |
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
As is already known and documented by avcodec_decode_video2, the input
buffer needs to be AV_INPUT_BUFFER_PADDING_SIZE larger than the actual
read bytes because some bistream readers read 32 or 64 bits at once and
can over-read.
I view this as a flaw and suggest this is fixed so that you don't have to
allocate more bytes than the encoded data. It shouldn't be a performance
issue because you can still read in 64 (or whatever) bit chunks up 'til
the very end.
(As someone who is using multiple libraries, FFmpeg is now a special case
when allocating buffers, and I feel like it shouldn't have to be.)
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5176>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list