avcodec/apedec: Allocate decoded_buffer after successful ff_get_buffer()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 2 Sep 2019 22:02:53 +0000 (00:02 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 28 Sep 2019 16:25:20 +0000 (18:25 +0200)
commitcf41da2ad2ec89a1e1c1ef3ca4f6a5b416f4104e
treec13f10c65ae4e8e2fd801dab8f902c9a0594a9d3
parent1e95a3e8a7250060befd9a5fba69151bb2a6690c
avcodec/apedec: Allocate decoded_buffer after successful ff_get_buffer()

We need to reset samples in this case to avoid being stuck with incorrect
samples value.

Fixes: OOM
Fixes: Timeout
Fixes: 16627/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5638059583864832
Fixes: 17089/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5672188463546368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/apedec.c