Commit 419800ac authored by Michael Niedermayer's avatar Michael Niedermayer

examples/avio_reading: fix null dereference on error

Fixed CID1197052
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1fec720a
...@@ -119,8 +119,10 @@ int main(int argc, char *argv[]) ...@@ -119,8 +119,10 @@ int main(int argc, char *argv[])
end: end:
avformat_close_input(&fmt_ctx); avformat_close_input(&fmt_ctx);
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */ /* note: the internal buffer could have changed, and be != avio_ctx_buffer */
if (avio_ctx) {
av_freep(&avio_ctx->buffer); av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx); av_freep(&avio_ctx);
}
av_file_unmap(buffer, buffer_size); av_file_unmap(buffer, buffer_size);
if (ret < 0) { if (ret < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment