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:
authorMarton Balint <cus@passwd.hu>2018-04-23 00:09:05 +0300
committerMarton Balint <cus@passwd.hu>2018-05-01 22:22:33 +0300
commitd89eea3455862a97963ac0701c51d9a1bdd21f19 (patch)
tree7fea66b5eaefbca73985390d2578b71cfc33a8e0 /libavdevice
parent0a22e31fbbbadcd481ebc702871192c54ecf1ee9 (diff)
avdevice/decklink_dec: unref packets on avpacket_queue_put error
Signed-off-by: Marton Balint <cus@passwd.hu> (cherry picked from commit 649087fa83a50e04a4ddd7f2f5f740a18ac28902)
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/decklink_dec.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index e97a4402ea..57004d7b06 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -467,16 +467,19 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt)
// Drop Packet if queue size is > maximum queue size
if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) {
+ av_packet_unref(pkt);
av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
return -1;
}
/* ensure the packet is reference counted */
if (av_packet_make_refcounted(pkt) < 0) {
+ av_packet_unref(pkt);
return -1;
}
pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList));
if (!pkt1) {
+ av_packet_unref(pkt);
return -1;
}
av_packet_move_ref(&pkt1->pkt, pkt);