mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-28 02:12:28 +00:00
avcodec/vlc: Attempt to free buf after use in ff_vlc_init_multi_from_lengths()
Fixes: use after free Fixes: 62153/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MAGICYUV_fuzzer-4702814909366272 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8d5db120c2
commit
2e04d35c69
@ -471,10 +471,13 @@ int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
ret = vlc_common_end(vlc, nb_bits, j, buf, flags, localbuf);
|
||||
ret = vlc_common_end(vlc, nb_bits, j, buf, flags, buf);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
return vlc_multi_gen(multi->table, vlc, nb_elems, j, nb_bits, buf, logctx);
|
||||
ret = vlc_multi_gen(multi->table, vlc, nb_elems, j, nb_bits, buf, logctx);
|
||||
if (buf != localbuf)
|
||||
av_free(buf);
|
||||
return ret;
|
||||
fail:
|
||||
if (buf != localbuf)
|
||||
av_free(buf);
|
||||
|
Loading…
Reference in New Issue
Block a user