It's set by the library when decoding, so it should be freed when closing the context.
Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -462,6 +462,8 @@ av_cold void ff_codec_close(AVCodecContext *avctx) · 461 unmodified lines | |||
| 462 | av_freep(&avctx->coded_side_data[i].data); | 462 | av_freep(&avctx->coded_side_data[i].data); |
| 463 | av_freep(&avctx->coded_side_data); | 463 | av_freep(&avctx->coded_side_data); |
| 464 | avctx->nb_coded_side_data = 0; | 464 | avctx->nb_coded_side_data = 0; |
| 465 | av_frame_side_data_free(&avctx->decoded_side_data, | ||
| 466 | &avctx->nb_decoded_side_data); | ||
| 465 | 467 | ||
| 466 | av_buffer_unref(&avctx->hw_frames_ctx); | 468 | av_buffer_unref(&avctx->hw_frames_ctx); |
| 467 | av_buffer_unref(&avctx->hw_device_ctx); | 469 | av_buffer_unref(&avctx->hw_device_ctx); |
| @@ -177,8 +177,6 @@ void avcodec_free_context(AVCodecContext **pavctx) · 176 unmodified lines | |||
| 177 | av_freep(&avctx->inter_matrix); | 177 | av_freep(&avctx->inter_matrix); |
| 178 | av_freep(&avctx->rc_override); | 178 | av_freep(&avctx->rc_override); |
| 179 | av_channel_layout_uninit(&avctx->ch_layout); | 179 | av_channel_layout_uninit(&avctx->ch_layout); |
| 180 | av_frame_side_data_free( | ||
| 181 | &avctx->decoded_side_data, &avctx->nb_decoded_side_data); | ||
| 182 | 180 | ||
| 183 | av_freep(pavctx); | 181 | av_freep(pavctx); |
| 184 | } | 182 | } |