Commit 44b34340 authored by Piotr Fusik's avatar Piotr Fusik Committed by Rémi Denis-Courmont

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

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 0505e064
...@@ -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