Commit 7563c871 authored by Piotr Fusik's avatar Piotr Fusik Committed by Jean-Baptiste Kempf

gme: fixed out-of-memory/out-of-range tests

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
(cherry picked from commit 44b34340a6d2d3b94f4260ad80e080b94fd18b3b)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 011d14cf
...@@ -262,7 +262,7 @@ static int Control (demux_t *demux, int query, va_list args) ...@@ -262,7 +262,7 @@ static int Control (demux_t *demux, int query, va_list args)
break; break;
int seek = (sys->titlev[sys->track_id]->i_length / 1000) * pos; int seek = (sys->titlev[sys->track_id]->i_length / 1000) * pos;
if (seek > INT_MAX || gme_seek (sys->emu, seek)) if (gme_seek (sys->emu, seek))
break; break;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -302,7 +302,7 @@ static int Control (demux_t *demux, int query, va_list args) ...@@ -302,7 +302,7 @@ static int Control (demux_t *demux, int query, va_list args)
unsigned n = sys->titlec; unsigned n = sys->titlec;
*titlev = malloc (sizeof (**titlev) * n); *titlev = malloc (sizeof (**titlev) * n);
if (unlikely(titlev == NULL)) if (unlikely(*titlev == NULL))
n = 0; n = 0;
*titlec = n; *titlec = n;
for (unsigned i = 0; i < n; i++) for (unsigned i = 0; i < n; i++)
......
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