Commit fdaa79ac authored by Jean-Paul Saman's avatar Jean-Paul Saman

VAAPI-XCB: check upper limit of cache_counter

It is possible for the cache_counter to reach its maximum value. In that case abort().
parent e9c4ac64
......@@ -22,6 +22,7 @@
#endif
#include <stdlib.h>
#include <limits.h>
#include <assert.h>
#include <vlc_common.h>
......@@ -71,6 +72,13 @@ static subpicture_cache_t *cache_new(void)
if (cache == NULL)
return NULL;
/* did we reach the maximum number of subpictures that can be created? */
if (cache_counter == UINT_MAX)
{
abort();
return NULL;
}
cache->i_id = ++cache_counter;
assert(cache_counter > 0);
vlc_array_init(&cache->subpictures);
......
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