Commit 7f2228db authored by Reimar Döffinger's avatar Reimar Döffinger

Make buffer size check consistent and avoid a possible overflow.

parent c940c31c
...@@ -40,7 +40,7 @@ static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t ...@@ -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;
} }
......
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