[FFmpeg-devel] lavc/ivi: Fix a Google-reported memleak

Submitted by Carl Eugen Hoyos on Dec. 3, 2018, 11:34 p.m.

Details

Message ID CAB0OVGqwH3UmC++4Uw6Kf8bgph3YFCiXQoH-zzAe+MQgoVjCpQ@mail.gmail.com
State Rejected
Headers show

Commit Message

Carl Eugen Hoyos Dec. 3, 2018, 11:34 p.m.
Hi!

Attached patch is supposed to fix a memleak from clusterfuzz, untested...

Please review, Carl Eugen

Comments

Michael Niedermayer Dec. 13, 2018, 1:39 a.m.
On Tue, Dec 04, 2018 at 12:34:27AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch is supposed to fix a memleak from clusterfuzz, untested...
> 
> Please review, Carl Eugen

>  ivi.c |    1 +
>  1 file changed, 1 insertion(+)
> f2714b796264d65e5f38b014966d810a168a919f  0001-lavc-ivi-Free-an-allocation-on-error.patch
> From f94d6415885293351201e74a3760aae7f206515a Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Tue, 4 Dec 2018 00:32:25 +0100
> Subject: [PATCH] lavc/ivi: Free an allocation on error.
> 
> Fixes a memleak reported as Issue 11696 in oss-fuzz.
> ---
>  libavcodec/ivi.c |    1 +
>  1 file changed, 1 insertion(+)

This does not fix the leak

[...]
Carl Eugen Hoyos Dec. 14, 2018, 6:58 p.m.
2018-12-13 2:39 GMT+01:00, Michael Niedermayer <michael@niedermayer.cc>:
> On Tue, Dec 04, 2018 at 12:34:27AM +0100, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch is supposed to fix a memleak from clusterfuzz, untested...
>>
>> Please review, Carl Eugen
>
>>  ivi.c |    1 +
>>  1 file changed, 1 insertion(+)
>> f2714b796264d65e5f38b014966d810a168a919f
>> 0001-lavc-ivi-Free-an-allocation-on-error.patch
>> From f94d6415885293351201e74a3760aae7f206515a Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
>> Date: Tue, 4 Dec 2018 00:32:25 +0100
>> Subject: [PATCH] lavc/ivi: Free an allocation on error.
>>
>> Fixes a memleak reported as Issue 11696 in oss-fuzz.
>> ---
>>  libavcodec/ivi.c |    1 +
>>  1 file changed, 1 insertion(+)
>
> This does not fix the leak

Sorry for the noise!

Carl Eugen

Patch hide | download patch | download mbox

From f94d6415885293351201e74a3760aae7f206515a Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Tue, 4 Dec 2018 00:32:25 +0100
Subject: [PATCH] lavc/ivi: Free an allocation on error.

Fixes a memleak reported as Issue 11696 in oss-fuzz.
---
 libavcodec/ivi.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c
index b23d4af..19bb01e 100644
--- a/libavcodec/ivi.c
+++ b/libavcodec/ivi.c
@@ -406,6 +406,7 @@  static int ivi_init_tiles(IVIBandDesc *band, IVITile *ref_tile,
             if (p || b) {
                 if (tile->num_MBs != ref_tile->num_MBs) {
                     av_log(NULL, AV_LOG_DEBUG, "ref_tile mismatch\n");
+                    av_freep(&tile->mbs);
                     return AVERROR_INVALIDDATA;
                 }
                 tile->ref_mbs = ref_tile->mbs;
-- 
1.7.10.4