mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
fix possible segfault
Origin commit data
------------------
Branch: master
Commit: c3261a5627
Author: GetAway <get-away@t-online.de>
Date: 2018-04-26 (Thu, 26 Apr 2018)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -158,7 +158,9 @@ int cVideo::setAspectRatio(int aspect, int mode)
|
|||||||
/* { "panscan", "letterbox", "fullscreen", "14:9", "(unset)" } */
|
/* { "panscan", "letterbox", "fullscreen", "14:9", "(unset)" } */
|
||||||
static const char *m[] = { "1", "2", "0", "1", "(unset)" };
|
static const char *m[] = { "1", "2", "0", "1", "(unset)" };
|
||||||
int n;
|
int n;
|
||||||
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mode < 0||mode > 3) ? 4 : mode]);
|
|
||||||
|
int mo = (mode < 0||mode > 3) ? 4 : mode;
|
||||||
|
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mo]);
|
||||||
|
|
||||||
if (aspect > 3 || aspect == 0)
|
if (aspect > 3 || aspect == 0)
|
||||||
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
|
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
|
||||||
@@ -173,8 +175,8 @@ int cVideo::setAspectRatio(int aspect, int mode)
|
|||||||
if (mode == -1)
|
if (mode == -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
lt_debug("%s: /proc/scalingmode -> %s\n", __func__, m[mode]);
|
lt_debug("%s: /proc/scalingmode -> %s\n", __func__, m[mo]);
|
||||||
n = proc_put("/proc/scalingmode", m[mode], strlen(m[mode]));
|
n = proc_put("/proc/scalingmode", m[mo], strlen(m[mo]));
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -365,7 +365,9 @@ int cVideo::setAspectRatio(int aspect, int mode)
|
|||||||
// static const char *m[] = { "panscan", "letterbox", "bestfit", "nonlinear", "(unset)" };
|
// static const char *m[] = { "panscan", "letterbox", "bestfit", "nonlinear", "(unset)" };
|
||||||
static const char *m[] = { "letterbox", "panscan", "bestfit", "nonlinear", "(unset)" };
|
static const char *m[] = { "letterbox", "panscan", "bestfit", "nonlinear", "(unset)" };
|
||||||
int n;
|
int n;
|
||||||
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mode < 0||mode > 3) ? 4 : mode]);
|
|
||||||
|
int mo = (mode < 0||mode > 3) ? 4 : mode;
|
||||||
|
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[mo]);
|
||||||
|
|
||||||
if (aspect > 3 || aspect == 0)
|
if (aspect > 3 || aspect == 0)
|
||||||
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
|
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
|
||||||
@@ -380,8 +382,8 @@ int cVideo::setAspectRatio(int aspect, int mode)
|
|||||||
if (mode == -1)
|
if (mode == -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
lt_debug("%s: /proc/stb/video/policy -> %s\n", __func__, m[mode]);
|
lt_debug("%s: /proc/stb/video/policy -> %s\n", __func__, m[mo]);
|
||||||
n = proc_put("/proc/stb/video/policy", m[mode], strlen(m[mode]));
|
n = proc_put("/proc/stb/video/policy", m[mo], strlen(m[mo]));
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -361,7 +361,9 @@ int cVideo::setAspectRatio(int aspect, int mode)
|
|||||||
static const char *a[] = { "n/a", "4:3", "14:9", "16:9" };
|
static const char *a[] = { "n/a", "4:3", "14:9", "16:9" };
|
||||||
static const char *m[] = { "panscan", "letterbox", "bestfit", "nonlinear", "(unset)" };
|
static const char *m[] = { "panscan", "letterbox", "bestfit", "nonlinear", "(unset)" };
|
||||||
int n;
|
int n;
|
||||||
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[(mode < 0||mode > 3) ? 4 : mode]);
|
|
||||||
|
int mo = (mode < 0||mode > 3) ? 4 : mode;
|
||||||
|
lt_debug("%s: a:%d m:%d %s\n", __func__, aspect, mode, m[mo]);
|
||||||
|
|
||||||
if (aspect > 3 || aspect == 0)
|
if (aspect > 3 || aspect == 0)
|
||||||
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
|
lt_info("%s: invalid aspect: %d\n", __func__, aspect);
|
||||||
@@ -376,8 +378,8 @@ int cVideo::setAspectRatio(int aspect, int mode)
|
|||||||
if (mode == -1)
|
if (mode == -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
lt_debug("%s: /proc/stb/video/policy -> %s\n", __func__, m[mode]);
|
lt_debug("%s: /proc/stb/video/policy -> %s\n", __func__, m[mo]);
|
||||||
n = proc_put("/proc/stb/video/policy", m[mode], strlen(m[mode]));
|
n = proc_put("/proc/stb/video/policy", m[mo], strlen(m[mo]));
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user