mirror of https://git.ffmpeg.org/ffmpeg.git
smoothstreamingenc: Fix a memory leak on errors
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
246f869590
commit
a863c97e99
|
@ -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…
Reference in New Issue