Browse Source

avformat/smoothstreamingenc: fix memleak

Fixes CID1224285
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
a53c5d454e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavformat/smoothstreamingenc.c

+ 2
- 1
libavformat/smoothstreamingenc.c View File

@@ -155,9 +155,10 @@ static void get_private_data(OutputStream *os)
return; return;
os->private_str = av_mallocz(2*size + 1); os->private_str = av_mallocz(2*size + 1);
if (!os->private_str) if (!os->private_str)
return;
goto fail;
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
snprintf(&os->private_str[2*i], 3, "%02x", ptr[i]); snprintf(&os->private_str[2*i], 3, "%02x", ptr[i]);
fail:
if (ptr != codec->extradata) if (ptr != codec->extradata)
av_free(ptr); av_free(ptr);
} }


Loading…
Cancel
Save