1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-29 16:23:10 +02:00

Make buffer size check consistent and avoid a possible overflow.

This commit is contained in:
Reimar Döffinger 2011-06-15 20:21:33 +02:00
parent c940c31c88
commit 7f2228dbfe

View File

@ -40,7 +40,7 @@ static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t
res = (res << 8) | *start++; res = (res << 8) | *start++;
} }
if (res + start > end) { if (end - start < res) {
return NULL; return NULL;
} }