Allocate extradata with av_malloc()
The extradata buffer is owned by libav, so it must be allocated with av_malloc(), not SDL_malloc(). This fixes a crash on Windows during avformat_free_context().
This commit is contained in:
parent
6c40dbd27d
commit
f5f4e6b1c5
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ static SDL_bool
|
||||||
recorder_write_header(struct recorder *recorder, AVPacket *packet) {
|
recorder_write_header(struct recorder *recorder, AVPacket *packet) {
|
||||||
AVStream *ostream = recorder->ctx->streams[0];
|
AVStream *ostream = recorder->ctx->streams[0];
|
||||||
|
|
||||||
uint8_t *extradata = SDL_malloc(packet->size * sizeof(uint8_t));
|
uint8_t *extradata = av_malloc(packet->size * sizeof(uint8_t));
|
||||||
if (!extradata) {
|
if (!extradata) {
|
||||||
LOGC("Cannot allocate extradata");
|
LOGC("Cannot allocate extradata");
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
|
|
Loading…
Reference in a new issue