Fixed CID1197052
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 419800acc46afc0c3b7319d6e216d0da207ebbb7)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -119,8 +119,10 @@ int main(int argc, char *argv[]) |
119 | 119 |
end: |
120 | 120 |
avformat_close_input(&fmt_ctx); |
121 | 121 |
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */ |
122 |
- av_freep(&avio_ctx->buffer); |
|
123 |
- av_freep(&avio_ctx); |
|
122 |
+ if (avio_ctx) { |
|
123 |
+ av_freep(&avio_ctx->buffer); |
|
124 |
+ av_freep(&avio_ctx); |
|
125 |
+ } |
|
124 | 126 |
av_file_unmap(buffer, buffer_size); |
125 | 127 |
|
126 | 128 |
if (ret < 0) { |