Fixes ticket #8295. Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> --- libavformat/nutenc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index e9a3bb49db..4d10e70e9e 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -1170,8 +1170,11 @@ static int nut_write_trailer(AVFormatContext *s) while (nut->header_count < 3) write_headers(s, bc); + if (!nut->sp_count) + return 0; + ret = avio_open_dyn_buf(&dyn_bc); - if (ret >= 0 && nut->sp_count) { + if (ret >= 0) { av_assert1(nut->write_index); // sp_count should be 0 if no index is going to be written write_index(nut, dyn_bc); put_packet(nut, bc, dyn_bc, 1, INDEX_STARTCODE); -- 2.20.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".