On Tue, Apr 24, 2018 at 10:12:30PM -0300, James Almer wrote: > On 4/24/2018 9:58 PM, Michael Niedermayer wrote: > > Fixes: > > 6798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5135899701542912 > > > > Found-by: continuous fuzzing process > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > > --- > > libavcodec/elsdec.c | 10 ++++++---- > > libavcodec/g2meet.c | 1 + > > 2 files changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/libavcodec/elsdec.c b/libavcodec/elsdec.c > > index 4797965457..8327662b4b 100644 > > --- a/libavcodec/elsdec.c > > +++ b/libavcodec/elsdec.c > > @@ -271,7 +271,7 @@ void ff_els_decoder_init(ElsDecCtx *ctx, const uint8_t > > *in, size_t data_size) > > > > void ff_els_decoder_uninit(ElsUnsignedRung *rung) > > { > > - av_free(rung->rem_rung_list); > > + av_freep(&rung->rem_rung_list); > > } > > > > static int els_import_byte(ElsDecCtx *ctx) > > @@ -389,16 +389,18 @@ unsigned ff_els_decode_unsigned(ElsDecCtx *ctx, > > ElsUnsignedRung *ur) > > else { > > if (!rung_node->next_index) { > > if (ur->rung_list_size <= (ur->avail_index + 2) * > > sizeof(ElsRungNode)) { > > + void *ptr_tmp; > > // remember rung_node position > > ptrdiff_t pos = rung_node - ur->rem_rung_list; > > - ur->rem_rung_list = av_realloc(ur->rem_rung_list, > > + ptr_tmp = av_realloc(ur->rem_rung_list, > > ur->rung_list_size + > > RUNG_SPACE); > > Use av_reallocp instead, to remove the tmp pointer and the av_freep call > below.
will push with that change thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Elect your leaders based on what they did after the last election, not based on what they say before an election.
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel