1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-20 07:48:15 +02:00
FFmpeg/libavformat
Andreas Rheinhardt 3f04c30372 avformat/swfdec: Reorder allocations/initializations
The earlier code would first attempt to allocate two buffers, then
attempt to allocate an AVIOContext, using one of the new buffers I/O
buffer, then check the allocations. On success, a z_stream that is used
in the AVIOContext's read_packet callback is initialized afterwards.

There are two problems with this: In case the allocation of the I/O
buffer fails avio_alloc_context() will be given a NULL read buffer
with a size > 0. This works right now, but it is fragile. The second
problem is that the z_stream used in the read_packet callback is not
functional when avio_alloc_context() is allocated (it might be that
avio_alloc_context() might already fill the buffer in the future). This
commit fixes both of these problems by reordering the operations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-09-23 17:09:01 +02:00
..
2020-09-18 11:34:11 +02:00
2020-06-22 12:19:56 +02:00
2020-09-04 16:01:53 +02:00
2020-09-18 11:30:03 +02:00
2020-09-18 11:34:11 +02:00
2020-06-18 21:31:13 +02:00
2020-09-03 18:11:00 +02:00
2020-09-20 18:03:52 +02:00
2020-09-03 18:03:18 +02:00
2020-09-13 16:05:01 +02:00
2020-09-18 11:34:11 +02:00
2020-07-26 16:47:01 +02:00