Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
scanfile: fix NULL dereference (srl_alt_type)
  • Loading branch information
perexg committed Mar 18, 2016
1 parent 850f8e4 commit 30e08bd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/input/mpegts/scanfile.c
Expand Up @@ -911,15 +911,17 @@ scanfile_region_list_t *
scanfile_find_region_list ( const char *type )
{
scanfile_region_list_t *list = NULL;
scanfile_region_list_t *ptr = scanfile_regions;
int i;
if (scanfile_regions == NULL)
if (ptr == NULL)
return NULL;
for (i = 0; i < REGIONS; i++)
if (strcasecmp(scanfile_regions[i].srl_type, type) == 0 ||
strcasecmp(scanfile_regions[i].srl_alt_type, type) == 0) {
list = &scanfile_regions[i];
for (i = 0; i < REGIONS; i++, ptr++) {
if (strcasecmp(ptr->srl_type, type) == 0 ||
(ptr->srl_alt_type && strcasecmp(ptr->srl_alt_type, type) == 0)) {
list = ptr;
break;
}
}
return list;
}

Expand Down

0 comments on commit 30e08bd

Please sign in to comment.