Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2017-11-11 15:12:06 +0300
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-11 16:19:05 +0300
commit7e76e1ea80052ee95ef33d5341b9251b90766c9c (patch)
tree9ffb9bb3da0c18753edb41b4f6ae9ecdfd3e61bf /libavcodec/wmavoice.c
parent8dd73f68a6319d1784b33da9553671f1a0c197f9 (diff)
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.
Diffstat (limited to 'libavcodec/wmavoice.c')
-rw-r--r--libavcodec/wmavoice.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 2ec4499981..3f86d0da35 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -1756,6 +1756,10 @@ static int synth_superframe(AVCodecContext *ctx, AVFrame *frame,
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 */
frame->nb_samples = MAX_SFRAMESIZE;
if ((res = ff_get_buffer(ctx, frame, 0)) < 0)