component(developer/golang-123): Add Component
[oi-userland.git] / components / multimedia / lame / patches / 01-Add-check-for-invalid-input-sample-rate.patch
blob26b9b24946da7639d8da577084f498dc87ac969c
1 From 1ea4eac3e7d57dbad42fb067a32ac1600a0397a0 Mon Sep 17 00:00:00 2001
2 From: Maks Naumov <maksqwe1@ukr.net>
3 Date: Thu, 22 Jan 2015 16:20:40 +0200
4 Subject: [PATCH] Add check for invalid input sample rate
6 Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
7 ---
8 libmp3lame/lame.c | 6 ++++++
9 1 file changed, 6 insertions(+)
11 --- a/libmp3lame/lame.c
12 +++ b/libmp3lame/lame.c
13 @@ -822,6 +822,12 @@ lame_init_params(lame_global_flags * gfp
15 #endif
17 + if (gfp->samplerate_in < 0 || gfp->num_channels < 0) {
18 + freegfc(gfc);
19 + gfp->internal_flags = NULL;
20 + return -1;
21 + }
23 cfg->disable_reservoir = gfp->disable_reservoir;
24 cfg->lowpassfreq = gfp->lowpassfreq;
25 cfg->highpassfreq = gfp->highpassfreq;