diff mbox

[FFmpeg-devel] fix minor leak in id3v2 parsing

Message ID CAEVbG5opSJm5qNynceSNGUo=peRg3FrmCMQ=yjLUfqR7wuux8w@mail.gmail.com
State New
Headers show

Commit Message

Fredrik Hubinette Oct. 24, 2017, 10:33 p.m. UTC
From a6a79bda55868f7faee0f183a45191d3251fb5f1 Mon Sep 17 00:00:00 2001
From: Fredrik Hubinette <hubbe@google.com>
Date: Tue, 7 Feb 2017 12:19:38 -0800
Subject: [PATCH] Fix minor ffmpeg memory leak in id3v2 parsing.

Reviewed-on: https://chromium-review.googlesource.com/439405
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
---
 libavformat/id3v2.c     | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

     end   = avio_rb32(pb);

Comments

James Almer Oct. 24, 2017, 10:38 p.m. UTC | #1
On 10/24/2017 7:33 PM, Fredrik Hubinette wrote:
> From a6a79bda55868f7faee0f183a45191d3251fb5f1 Mon Sep 17 00:00:00 2001
> From: Fredrik Hubinette <hubbe@google.com>
> Date: Tue, 7 Feb 2017 12:19:38 -0800
> Subject: [PATCH] Fix minor ffmpeg memory leak in id3v2 parsing.
> 
> Reviewed-on: https://chromium-review.googlesource.com/439405
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> ---
>  libavformat/id3v2.c     | 4 ++--
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
> index 9969d7a6ca..b3036d2f87 100644
> --- a/libavformat/id3v2.c
> +++ b/libavformat/id3v2.c
> @@ -688,9 +688,9 @@ static void read_chapter(AVFormatContext *s,
> AVIOContext *pb, int len, const cha
>      }
> 
>      if (decode_str(s, pb, 0, &dst, &len) < 0)
> -        return;
> +      goto end;
>      if (len < 16)
> -        return;
> +      goto end;
> 
>      start = avio_rb32(pb);
>      end   = avio_rb32(pb);
> 

This doesn't seem to apply to git head, or even the recently cut 3.4
branch. Was this patch made for the 3.3 branch?
Moritz Barsnick Oct. 24, 2017, 11:09 p.m. UTC | #2
On Tue, Oct 24, 2017 at 19:38:58 -0300, James Almer wrote:
> > Subject: [PATCH] Fix minor ffmpeg memory leak in id3v2 parsing.
> > 
> > Reviewed-on: https://chromium-review.googlesource.com/439405
> > Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
[...]
> This doesn't seem to apply to git head, or even the recently cut 3.4
> branch. Was this patch made for the 3.3 branch?

This code was changed/fixed on master 20 days ago by
1fd80106be3dca9fa0ea13fb364c8d221bd27c15, even before 3.4 was branched.

The fix may be valid for < 3.4 nonetheless. Is Chromium not using
master?

Moritz
James Almer Oct. 26, 2017, 4:57 p.m. UTC | #3
On 10/24/2017 8:09 PM, Moritz Barsnick wrote:
> On Tue, Oct 24, 2017 at 19:38:58 -0300, James Almer wrote:
>>> Subject: [PATCH] Fix minor ffmpeg memory leak in id3v2 parsing.
>>>
>>> Reviewed-on: https://chromium-review.googlesource.com/439405
>>> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> [...]
>> This doesn't seem to apply to git head, or even the recently cut 3.4
>> branch. Was this patch made for the 3.3 branch?
> 
> This code was changed/fixed on master 20 days ago by
> 1fd80106be3dca9fa0ea13fb364c8d221bd27c15, even before 3.4 was branched.
> 
> The fix may be valid for < 3.4 nonetheless. Is Chromium not using
> master?
> 
> Moritz

They may be using master but didn't fetch new commits since late
September or similar.

Pushed to 3.3 branch in any case. It will be in the 3.3.5 release.
Fredrik Hubinette Oct. 30, 2017, 5:49 p.m. UTC | #4
Sorry, it was an old patch that I had delayed to submit for various reasons.
Glad it's fixed.

      /Hubbe

On Thu, Oct 26, 2017 at 9:57 AM, James Almer <jamrial@gmail.com> wrote:

> On 10/24/2017 8:09 PM, Moritz Barsnick wrote:
> > On Tue, Oct 24, 2017 at 19:38:58 -0300, James Almer wrote:
> >>> Subject: [PATCH] Fix minor ffmpeg memory leak in id3v2 parsing.
> >>>
> >>> Reviewed-on: https://chromium-review.googlesource.com/439405
> >>> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> > [...]
> >> This doesn't seem to apply to git head, or even the recently cut 3.4
> >> branch. Was this patch made for the 3.3 branch?
> >
> > This code was changed/fixed on master 20 days ago by
> > 1fd80106be3dca9fa0ea13fb364c8d221bd27c15, even before 3.4 was branched.
> >
> > The fix may be valid for < 3.4 nonetheless. Is Chromium not using
> > master?
> >
> > Moritz
>
> They may be using master but didn't fetch new commits since late
> September or similar.
>
> Pushed to 3.3 branch in any case. It will be in the 3.3.5 release.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
diff mbox

Patch

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index 9969d7a6ca..b3036d2f87 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -688,9 +688,9 @@  static void read_chapter(AVFormatContext *s,
AVIOContext *pb, int len, const cha
     }

     if (decode_str(s, pb, 0, &dst, &len) < 0)
-        return;
+      goto end;
     if (len < 16)
-        return;
+      goto end;

     start = avio_rb32(pb);