[FFmpeg-cvslog] avfilter/vf_pullup: fix memleak on error

Michael Niedermayer git at videolan.org
Fri Dec 13 15:20:06 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 13 15:14:03 2013 +0100| [47eb15b989a0bbeef6647ec97d9ee646cb8e901a] | committer: Michael Niedermayer

avfilter/vf_pullup: fix memleak on error

Fixes CID1108604

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47eb15b989a0bbeef6647ec97d9ee646cb8e901a
---

 libavfilter/vf_pullup.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_pullup.c b/libavfilter/vf_pullup.c
index d0b910f..58d4d7a 100644
--- a/libavfilter/vf_pullup.c
+++ b/libavfilter/vf_pullup.c
@@ -157,13 +157,17 @@ static PullupField *make_field_queue(PullupContext *s, int len)
 
     for (; len > 0; len--) {
         f->next = av_mallocz(sizeof(*f->next));
-        if (!f->next)
+        if (!f->next) {
+            free_field_queue(head, &f);
             return NULL;
+        }
 
         f->next->prev = f;
         f = f->next;
-        if (alloc_metrics(s, f) < 0)
+        if (alloc_metrics(s, f) < 0) {
+            free_field_queue(head, &f);
             return NULL;
+        }
     }
 
     f->next = head;



More information about the ffmpeg-cvslog mailing list