[FFmpeg-trac] #1740(avformat:closed): avformat's av_write_trailer have bug.
FFmpeg
trac at avcodec.org
Tue Sep 18 03:47:20 CEST 2012
#1740: avformat's av_write_trailer have bug.
------------------------------------+------------------------------------
Reporter: kyh96403 | Owner:
Type: defect | Status: closed
Priority: important | Component: avformat
Version: git-master | Resolution: fixed
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+------------------------------------
Comment (by kyh96403):
Crash when using ffserver's RTSP UDP connection.
When close RTSP UDP connection, each RTP also close.
That code is below..
{{{
for(i=0;i<nb_streams;i++) {
ctx = c->rtp_ctx[i];
if (ctx) {
av_write_trailer(ctx);
av_dict_free(&ctx->metadata);
av_free(ctx->streams[0]);
av_free(ctx);
}
h = c->rtp_handles[i];
if (h)
ffurl_close(h);
}
}}}
You know, c->rtp_ctx[i]->pb using dyn_buf.
dyn_buf's pb is not safe when after using avio_close_dyn_buf.
So it is need set pb to NULL or avio_open_dyn_buf before call
av_write_trailer.
Old version don't have problem.
Because av_write_trailer don't using ctx->pb.
Today that problem is fixed...
Thanks~~
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1740#comment:3>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list