aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/huffman.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-14 04:58:34 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:57 +0100
commit5e95dc426e94a1161b2cf66031b5ef24a6f27ff9 (patch)
tree43de46d05bd3a0f9e4f0e02840e48979e5fb56d2 /libavcodec/huffman.c
parente7780f16153051f9b169e8bdd6f0696ca03e5f34 (diff)
downloadffmpeg-5e95dc426e94a1161b2cf66031b5ef24a6f27ff9.tar.gz
avcodec/ffv1: Fix segfaults on allocation error
When allocating FFV1 slice contexts fails, ff_ffv1_init_slice_contexts() frees everything that it has allocated, yet it does not reset the counter for the number of allocated slice contexts. This inconsistent state leads to segfaults lateron in ff_ffv1_close(), because said function presumes that the slice contexts have been allocated. Fix this by making sure that the number of slice contexts on error is consistent (namely zero). (This issue only affected the FFV1 decoder, because the encoder does not clean up after itself on init failure.) Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit a0750f412ade5a969b1f90e038d707d531c97342)
Diffstat (limited to 'libavcodec/huffman.c')
0 files changed, 0 insertions, 0 deletions