diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-01 10:05:16 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-05 21:52:11 +0200 |
commit | a68a6322b78c27a58ab32174814efadf79701226 (patch) | |
tree | 517e7af49bd41b7ad0fa59f88586b1addbf00cd8 /libswresample/version_major.h | |
parent | 6ed0d95fa207f587b3542f3e8349932118ad8d5d (diff) | |
download | ffmpeg-a68a6322b78c27a58ab32174814efadf79701226.tar.gz |
avformat/mpegenc: Fix ever growing FIFO and infinite loop on error
Since the switch to the new FIFO API in commit
ea511196a6c85eb433e10cdbecb0b2c722faf20d, the FIFO is always
grown by the amount of data intended to be written into it
even in case the FIFO has enough free space. Fix this by
only growing the FIFO if needed and then only by the amount that is
actually needed.
The allocation errors that resulted from this uncovered another bug:
The context is left in an inconsistent state in case the FIFO can't
be grown, because the FIFO does not contain as much data as the sizes
contained in the PacketDesc list claim. This led to an infinite loop
in output_packet() (called from mpeg_mux_end()).
Fix this by growing the FIFO before adding a new PacketDesc element,
thereby preventing the context from becoming inconsistent.
Reported-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libswresample/version_major.h')
0 files changed, 0 insertions, 0 deletions