file-psp: fix for bogus input data. Fixes bug #639203

This commit is contained in:
Simon Budig 2011-02-14 21:46:31 +01:00
parent 7fb0300e1c
commit 48ec15890e
1 changed files with 4 additions and 0 deletions

View File

@ -1197,6 +1197,10 @@ read_channel_data (FILE *f,
}
else
fread (buf, runcount, 1, f);
/* prevent buffer overflow for bogus data */
runcount = MIN (runcount, endq - q);
if (bytespp == 1)
{
memmove (q, buf, runcount);