diff options
Diffstat (limited to 'binding/afm-mediaplayer-binding.c')
-rw-r--r-- | binding/afm-mediaplayer-binding.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index 5b49694..b25418c 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -537,7 +537,15 @@ static void gstreamer_controls(afb_req_t request) } case VOLUME_CMD: { const char *parameter = afb_req_value(request, "volume"); - long int volume = strtol(parameter, NULL, 10); + long int volume; + + if (!parameter) { + afb_req_fail(request, "failed", "invalid volume"); + return; + } + + volume = strtol(parameter, NULL, 10); + errno = 0; if (volume == 0 && errno) { afb_req_fail(request, "failed", "invalid volume"); |