diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 97942bf023..1d8c5ea7d6 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -810,7 +810,7 @@ static int do_encrypt(AVFormatContext *s, VariantStream *vs) return ret; avio_seek(pb, 0, SEEK_CUR); avio_write(pb, key, KEYSIZE); - avio_close(pb); + ff_format_io_close(s, &pb); } return 0; }