| ... | ... |
@@ -783,7 +783,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) |
| 783 | 783 |
avctx->codec->close(avctx); |
| 784 | 784 |
avcodec_default_free_buffers(avctx); |
| 785 | 785 |
avctx->coded_frame = NULL; |
| 786 |
- if (avctx->codec->priv_class) |
|
| 786 |
+ if (avctx->codec && avctx->codec->priv_class) |
|
| 787 | 787 |
av_opt_free(avctx->priv_data); |
| 788 | 788 |
av_opt_free(avctx); |
| 789 | 789 |
av_freep(&avctx->priv_data); |