mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
CAutoModeNotifier: avoid out-of-bounds access
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7c6e91d045
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-05-25 (Sat, 25 May 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -556,9 +556,17 @@ bool CAutoModeNotifier::changeNotify(const neutrino_locale_t /*OptionName*/, voi
|
||||
int i;
|
||||
int modes[VIDEO_STD_MAX+1];
|
||||
|
||||
memset(modes, 0, sizeof(int)*VIDEO_STD_MAX+1);
|
||||
memset(modes, 0, sizeof(modes));
|
||||
|
||||
for(i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) {
|
||||
if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key < 0) /* not available on this platform */
|
||||
continue;
|
||||
if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key >= VIDEO_STD_MAX) {
|
||||
/* this must not happen */
|
||||
printf("CAutoModeNotifier::changeNotify VIDEOMODE_OPTIONS[%d].key = %d (>= %d)\n",
|
||||
i, VIDEOMENU_VIDEOMODE_OPTIONS[i].key, VIDEO_STD_MAX);
|
||||
continue;
|
||||
}
|
||||
modes[VIDEOMENU_VIDEOMODE_OPTIONS[i].key] = g_settings.enabled_video_modes[i];
|
||||
}
|
||||
videoDecoder->SetAutoModes(modes);
|
||||
|
Reference in New Issue
Block a user