Skip to content
Snippets Groups Projects
Commit 6995b0be authored by Miguel Borges de Freitas's avatar Miguel Borges de Freitas Committed by Jean-Baptiste Kempf
Browse files

Add additional safeguards


Co-authored-by: default avatarVoyager1 <voyager@xbmc.org>
parent 3a61b52f
No related branches found
No related tags found
Loading
Pipeline #228891 passed with stage
in 59 seconds
......@@ -1426,7 +1426,7 @@ user_ops_t dvdnav_get_restrictions(dvdnav_t* this) {
ops.ops_int = 0;
if(!this->started) {
if(!this || !this->started) {
printerr("Virtual DVD machine not started.");
return ops.ops_struct;
}
......
......@@ -28,6 +28,7 @@
#include "config.h"
#endif
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
#include <limits.h>
......@@ -335,6 +336,7 @@ dvdnav_status_t dvdnav_free_cache_block(dvdnav_t *self, unsigned char *buf) {
for (i = 0; i < READ_CACHE_CHUNKS; i++) {
if (cache->chunk[i].cache_buffer && buf >= cache->chunk[i].cache_buffer &&
buf < cache->chunk[i].cache_buffer + cache->chunk[i].cache_malloc_size * DVD_VIDEO_LB_LEN) {
assert(cache->chunk[i].usage_count > 0);
cache->chunk[i].usage_count--;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment