提交 e7de41fc 编写于 作者: J jp9000

deps/media-playback: Free frame data before freeing frame

Prevents a potential memory leak if data was previously allocated in the
frame.
上级 548f3fa9
......@@ -173,9 +173,10 @@ void mp_decode_free(struct mp_decode *d)
avcodec_close(d->decoder);
#endif
}
if (d->frame)
if (d->frame) {
av_frame_unref(d->frame);
av_free(d->frame);
}
memset(d, 0, sizeof(*d));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册