X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=doc%2Fexamples%2Favio_reading.c;h=36ee02afa541a6d87ec87f0f52ae73221567ece9;hb=aa6c757d50ca060cab05c3a822a43563934823a1;hp=cbfeb174b8ce43c5fed7510bcb940e8126a7b3ed;hpb=ef71ef5f30ddf1cd61e46628a04608892caf76d2;p=ffmpeg diff --git a/doc/examples/avio_reading.c b/doc/examples/avio_reading.c index cbfeb174b8c..36ee02afa54 100644 --- a/doc/examples/avio_reading.c +++ b/doc/examples/avio_reading.c @@ -117,11 +117,12 @@ int main(int argc, char *argv[]) end: avformat_close_input(&fmt_ctx); + /* note: the internal buffer could have changed, and be != avio_ctx_buffer */ - if (avio_ctx) { + if (avio_ctx) av_freep(&avio_ctx->buffer); - av_freep(&avio_ctx); - } + avio_context_free(&avio_ctx); + av_file_unmap(buffer, buffer_size); if (ret < 0) {