1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-20 07:48:15 +02:00
FFmpeg/libavformat
Andreas Rheinhardt 9637dc8ebd 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>
(cherry picked from commit 3f04c3037223f5e5417a14674103f3eeabb4887c)
2021-02-27 07:20:58 +01:00
..
2021-02-20 14:21:24 +01:00
2021-02-02 14:18:21 +01:00
2020-05-31 00:55:12 +02:00
2020-11-08 00:26:11 +10:00
2020-03-17 22:46:36 +01:00
2021-02-02 14:18:21 +01:00
2021-02-02 14:18:21 +01:00
2021-02-02 14:18:21 +01:00
2020-03-17 16:05:49 +01:00
2021-02-02 14:18:21 +01:00
2021-02-02 14:18:21 +01:00
2021-02-02 14:18:21 +01:00
2020-03-17 16:08:13 +01:00
2020-05-30 18:02:55 +02:00
2020-05-19 20:09:25 +02:00
2021-02-02 14:18:21 +01:00
2020-05-31 00:55:12 +02:00
2020-04-19 02:37:46 +02:00
2021-02-02 14:18:21 +01:00
2020-03-17 22:46:36 +01:00
2021-02-02 14:18:21 +01:00
2020-06-06 00:25:00 +02:00
2020-06-06 00:25:00 +02:00
2020-05-19 20:09:25 +02:00
2021-02-20 14:21:24 +01:00
2020-06-04 10:52:42 +02:00
2020-06-14 22:02:34 +02:00
2021-02-02 14:18:21 +01:00