diff options
author | Marton Balint <cus@passwd.hu> | 2020-03-05 23:28:12 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2020-03-08 12:56:08 +0100 |
commit | af7ec793d49e260aa4c5595d4947322fc91aa72d (patch) | |
tree | bb536b15c122381e74d3525d1e821d22e9808d04 /fftools | |
parent | cb3c77cfeed3d9b995fc8b387a1ef14561a4b6ea (diff) | |
download | ffmpeg-af7ec793d49e260aa4c5595d4947322fc91aa72d.tar.gz |
fftools/ffplay: fix possible memory leak in decoder
Fixes ticket #8549.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'fftools')
-rw-r--r-- | fftools/ffplay.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fftools/ffplay.c b/fftools/ffplay.c index fee0619f7c..f6511e4afd 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -644,7 +644,10 @@ static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) { if (packet_queue_get(d->queue, &pkt, 1, &d->pkt_serial) < 0) return -1; } - } while (d->queue->serial != d->pkt_serial); + if (d->queue->serial == d->pkt_serial) + break; + av_packet_unref(&pkt); + } while (1); if (pkt.data == flush_pkt.data) { avcodec_flush_buffers(d->avctx); |