Skip to content
Snippets Groups Projects
Commit 549985ee authored by Philippe Gorley's avatar Philippe Gorley Committed by Guillaume Roguez
Browse files

media: fix mismatched free and double free


FFmpeg frees and reallocs the buffer multiple times internally, which
means 2 things:
1. Mismatched free, as std::vector uses new, FFmpeg uses free.
2. buf_ no longer points to the correct address by the time it goes out
of scope; it points to an already freed part of memory.

Use a local variable instead of a class member to store the initial
buffer.

Change-Id: Ibe98658e68bec1b69875e6679ba1319dd7d98706
Reviewed-by: default avatarGuillaume Roguez <guillaume.roguez@savoirfairelinux.com>
parent 14cbbf6f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment