When getting the PGCN the nav vm might be null. But it
From: Erik Hovland <erik@hovland.org>
doesn't properly check.
This patch fixes that.
---
libs/libmythdvdnav/vm.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/libs/libmythdvdnav/vm.c b/libs/libmythdvdnav/vm.c
index b0d8633..4d0f4bc 100644
a
|
b
|
int vm_get_current_menu(vm_t *vm, int *menuid) { |
633 | 633 | int pgcn; |
634 | 634 | pgcn = (vm->state).pgcN; |
635 | 635 | pgcit = get_PGCIT(vm); |
| 636 | if (!pgcit) |
| 637 | return 0; |
| 638 | |
636 | 639 | *menuid = pgcit->pgci_srp[pgcn - 1].entry_id & 0xf ; |
637 | 640 | return 1; |
638 | 641 | } |
… |
… |
static pgcit_t* get_MENU_PGCIT(vm_t *vm, ifo_handle_t *h, uint16_t lang) { |
1845 | 1848 | |
1846 | 1849 | /* Uses state to decide what to return */ |
1847 | 1850 | static pgcit_t* get_PGCIT(vm_t *vm) { |
1848 | | pgcit_t *pgcit; |
| 1851 | pgcit_t *pgcit = 0; |
| 1852 | |
| 1853 | if (!(vm->vtsi) && ((vm->state).domain == VTS_DOMAIN || (vm->state).domain == VTSM_DOMAIN)) |
| 1854 | return pgcit; |
1849 | 1855 | |
1850 | 1856 | switch ((vm->state).domain) { |
1851 | 1857 | case VTS_DOMAIN: |