Commit 1de4047a authored by Thomas Guillem's avatar Thomas Guillem

demux: image: fix heap-use-after-free

detect callbacks can call vlc_stream_Peek() and invalidate the current peek
buffer is re-allocation is needed.

An other way to solve this issue is to make sure that checks with a callback
are executed after checks with a marker/marker_size.
parent b2fb79e3
......@@ -637,6 +637,8 @@ static int Open(vlc_object_t *object)
if (img->detect) {
if (img->detect(demux->s))
break;
/* detect callbacks can invalidate the current peek buffer */
peek_size = 0;
} else {
if ((size_t) peek_size < img->marker_size)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment