diff mbox

[FFmpeg-devel] avformat/nutenc: Fix memleak

Message ID 20191017090606.23639-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 1d479300cbe0522c233b7d51148aea2b29bd29ad
Headers show

Commit Message

Andreas Rheinhardt Oct. 17, 2019, 9:06 a.m. UTC
Fixes ticket #8295.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/nutenc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Oct. 19, 2019, 4:01 p.m. UTC | #1
On Thu, Oct 17, 2019 at 11:06:06AM +0200, Andreas Rheinhardt wrote:
> Fixes ticket #8295.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavformat/nutenc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

will apply

thx

[...]
James Almer Oct. 19, 2019, 7:17 p.m. UTC | #2
On 10/19/2019 1:01 PM, Michael Niedermayer wrote:
> On Thu, Oct 17, 2019 at 11:06:06AM +0200, Andreas Rheinhardt wrote:
>> Fixes ticket #8295.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
>> ---
>>  libavformat/nutenc.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> will apply
> 
> thx

I'm sorry, i didn't pay attention, wrote pretty much the same patch last
night, and applied it.
Michael Niedermayer Oct. 19, 2019, 9:29 p.m. UTC | #3
On Sat, Oct 19, 2019 at 04:17:24PM -0300, James Almer wrote:
> On 10/19/2019 1:01 PM, Michael Niedermayer wrote:
> > On Thu, Oct 17, 2019 at 11:06:06AM +0200, Andreas Rheinhardt wrote:
> >> Fixes ticket #8295.
> >>
> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> >> ---
> >>  libavformat/nutenc.c | 5 ++++-
> >>  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > will apply
> > 
> > thx
> 
> I'm sorry, i didn't pay attention, wrote pretty much the same patch last
> night, and applied it.

this seems to happen more commonly recently
i think thats a good sign, if we are getting collisions between bugfixes
it means we are running out of at least some of the easier bugfixes

[...]
diff mbox

Patch

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index e9a3bb49db..4d10e70e9e 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -1170,8 +1170,11 @@  static int nut_write_trailer(AVFormatContext *s)
     while (nut->header_count < 3)
         write_headers(s, bc);
 
+    if (!nut->sp_count)
+        return 0;
+
     ret = avio_open_dyn_buf(&dyn_bc);
-    if (ret >= 0 && nut->sp_count) {
+    if (ret >= 0) {
         av_assert1(nut->write_index); // sp_count should be 0 if no index is going to be written
         write_index(nut, dyn_bc);
         put_packet(nut, bc, dyn_bc, 1, INDEX_STARTCODE);