Commit 9c3478c2 authored by Lukasz Marek's avatar Lukasz Marek Committed by Michael Niedermayer

tools/uncoded_frame: fix double free

in case av_interleaved_write_uncoded_frame fails it seems
frame is freed for the second time in fail section.
Signed-off-by: 's avatarLukasz Marek <lukasz.m.luki@gmail.com>
Reviewed-by: 's avatarNicolas George <george@nsup.org>

This commit also removes 1 trailing whitespace as otherwise the push hook rejects it
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e03c1af5
...@@ -182,7 +182,7 @@ int main(int argc, char **argv) ...@@ -182,7 +182,7 @@ int main(int argc, char **argv)
st->stream->codec->channel_layout = st->link->channel_layout; st->stream->codec->channel_layout = st->link->channel_layout;
st->stream->codec->channels = avfilter_link_get_channels(st->link); st->stream->codec->channels = avfilter_link_get_channels(st->link);
st->stream->codec->sample_rate = st->link->sample_rate; st->stream->codec->sample_rate = st->link->sample_rate;
st->stream->codec->sample_fmt = st->link->format; st->stream->codec->sample_fmt = st->link->format;
break; break;
default: default:
av_assert0(!"reached"); av_assert0(!"reached");
...@@ -245,12 +245,12 @@ int main(int argc, char **argv) ...@@ -245,12 +245,12 @@ int main(int argc, char **argv)
ret = av_interleaved_write_uncoded_frame(st->mux, ret = av_interleaved_write_uncoded_frame(st->mux,
st->stream->index, st->stream->index,
frame); frame);
frame = NULL;
if (ret < 0) { if (ret < 0) {
av_log(st->stream->codec, AV_LOG_ERROR, av_log(st->stream->codec, AV_LOG_ERROR,
"Error writing frame: %s\n", av_err2str(ret)); "Error writing frame: %s\n", av_err2str(ret));
goto fail; goto fail;
} }
frame = NULL;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment