wmavoice: free frame before ff_get_buffer

synth_superframe can be called twice per call to decode_packet.
It is not fully clear if calling ff_get_buffer on the same frame twice
is supported, so unref the frame first to be save.
pull/272/head
Timo Rothenpieler 7 years ago
parent 8dd73f68a6
commit 7e76e1ea80
  1. 4
      libavcodec/wmavoice.c

@ -1756,6 +1756,10 @@ static int synth_superframe(AVCodecContext *ctx, AVFrame *frame,
stabilize_lsps(lsps[n], s->lsps); stabilize_lsps(lsps[n], s->lsps);
} }
/* synth_superframe can run multiple times per packet
* free potential previous frame */
av_frame_unref(frame);
/* get output buffer */ /* get output buffer */
frame->nb_samples = MAX_SFRAMESIZE; frame->nb_samples = MAX_SFRAMESIZE;
if ((res = ff_get_buffer(ctx, frame, 0)) < 0) if ((res = ff_get_buffer(ctx, frame, 0)) < 0)

Loading…
Cancel
Save