Browse Source

examples/avio_reading: fix null dereference on error

Fixed CID1197052
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 12 years ago
parent
commit
419800acc4
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      doc/examples/avio_reading.c

+ 4
- 2
doc/examples/avio_reading.c View File

@@ -119,8 +119,10 @@ int main(int argc, char *argv[])
end:
avformat_close_input(&fmt_ctx);
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */
av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx);
if (avio_ctx) {
av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx);
}
av_file_unmap(buffer, buffer_size);

if (ret < 0) {


Loading…
Cancel
Save