From bbfb2c8077d0b865135c50d3f4aa40a42aefb9ac Mon Sep 17 00:00:00 2001
From: Jai Menon <jmenon86@gmail.com>
Date: Sat, 17 Jul 2010 05:40:18 +0000
Subject: [PATCH] avidec : Free packet if dv_produce_packet fails.

Originally committed as revision 24281 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/avidec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 058acd52632..05cfd98cbe3 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -808,6 +808,8 @@ resync:
                                     pkt->data, pkt->size);
             pkt->destruct = dstr;
             pkt->flags |= AV_PKT_FLAG_KEY;
+            if (size < 0)
+                av_free_packet(pkt);
         } else {
             /* XXX: How to handle B-frames in AVI? */
             pkt->dts = ast->frame_offset;
-- 
GitLab