mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-12-12 05:35:56 +00:00
avformat/nutenc: free all missing dynamic AVIOContext on header writing failure
Fixes part of ticket #8316 Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
58bb9d3a3a
commit
90e37adab7
@ -637,8 +637,10 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = write_streamheader(avctx, dyn_bc, nut->avf->streams[i], i);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
ffio_free_dyn_buf(&dyn_bc);
|
||||
return ret;
|
||||
}
|
||||
put_packet(nut, bc, dyn_bc, 1, STREAM_STARTCODE);
|
||||
}
|
||||
|
||||
@ -653,12 +655,13 @@ static int write_headers(AVFormatContext *avctx, AVIOContext *bc)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = write_streaminfo(nut, dyn_bc, i);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
put_packet(nut, bc, dyn_bc, 1, INFO_STARTCODE);
|
||||
else
|
||||
else {
|
||||
ffio_free_dyn_buf(&dyn_bc);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nut->avf->nb_chapters; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user