ffmpeg/libavcodec
Andreas Rheinhardt b0997b8526 avcodec/rv34, mpegvideo: Fix segfault upon frame size change error
The RealVideo 3.0 and 4.0 decoders call ff_mpv_common_init() only during
their init function and not during decode_frame(); when the size of the
frame changes, they call ff_mpv_common_frame_size_change(). Yet upon
error, said function calls ff_mpv_common_end() which frees the whole
MpegEncContext and not only those parts that
ff_mpv_common_frame_size_change() reinits. As a result, the context will
never be usable again; worse, because decode_frame() contains no check
for whether the context is initialized or not, it is presumed that it is
initialized, leading to segfaults. Basically the same happens if
rv34_decoder_realloc() fails.

This commit fixes this by only resetting the parts that
ff_mpv_common_frame_size_change() changes upon error and by actually
checking whether the context is in need of reinitialization in
ff_rv34_decode_frame().

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 9abda1365c5e2d827eb673b6d98245163c868bf1)
2021-04-08 11:56:44 +02:00
..
2021-02-27 17:09:44 +01:00
2021-03-05 19:45:00 +02:00
2021-03-09 13:41:22 +01:00
2021-02-27 17:09:44 +01:00
2021-03-01 06:10:44 +01:00
2021-03-01 17:36:42 +01:00
2021-03-01 17:36:42 +01:00
2021-02-09 15:01:34 +01:00
2021-03-09 13:41:22 +01:00
2021-03-08 19:19:19 +01:00
2021-03-09 13:41:22 +01:00
2021-03-01 06:10:44 +01:00
2021-03-08 19:19:19 +01:00
2021-03-09 13:41:22 +01:00
2021-02-04 17:26:06 +01:00
2021-03-01 17:36:16 +01:00
2021-03-09 13:41:22 +01:00
2021-03-09 13:41:22 +01:00
2021-02-02 14:29:33 +01:00
2021-03-09 13:41:22 +01:00
2021-04-03 13:29:30 +02:00
2021-04-01 11:38:44 +02:00
2021-03-05 19:45:00 +02:00
2021-03-05 19:45:00 +02:00
2021-04-02 21:40:54 +02:00
2021-03-09 13:41:22 +01:00
2021-01-25 00:18:47 +01:00