diff mbox

[FFmpeg-devel,6/9] opusenc: Fix double-declaration of variable

Message ID 20171017211225.3175-6-sw@jkqxz.net
State Accepted
Commit 242d8c8763d86f27ad3d63a4d48deccbb133c6c7
Headers show

Commit Message

Mark Thompson Oct. 17, 2017, 9:12 p.m. UTC
---
 libavcodec/opusenc_psy.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Rostislav Pehlivanov Oct. 17, 2017, 10:58 p.m. UTC | #1
On 17 October 2017 at 22:12, Mark Thompson <sw@jkqxz.net> wrote:

> ---
>  libavcodec/opusenc_psy.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/libavcodec/opusenc_psy.c b/libavcodec/opusenc_psy.c
> index b446d41f75..1b108ecb87 100644
> --- a/libavcodec/opusenc_psy.c
> +++ b/libavcodec/opusenc_psy.c
> @@ -370,7 +370,6 @@ static int celt_search_for_tf(OpusPsyContext *s,
> OpusPsyStep **start, CeltFrame
>      for (cway = 0; cway < 2; cway++) {
>          int mag[2];
>          int base = f->transient ? 120 : 960;
> -        int i;
>
>          for (i = 0; i < 2; i++) {
>              int c = ff_celt_tf_select[f->size][f->transient][cway][i];
> --
> 2.11.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

LGTM
Mark Thompson Oct. 18, 2017, 7:11 p.m. UTC | #2
On 17/10/17 23:58, Rostislav Pehlivanov wrote:
> On 17 October 2017 at 22:12, Mark Thompson <sw@jkqxz.net> wrote:
> 
>> ---
>>  libavcodec/opusenc_psy.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/libavcodec/opusenc_psy.c b/libavcodec/opusenc_psy.c
>> index b446d41f75..1b108ecb87 100644
>> --- a/libavcodec/opusenc_psy.c
>> +++ b/libavcodec/opusenc_psy.c
>> @@ -370,7 +370,6 @@ static int celt_search_for_tf(OpusPsyContext *s,
>> OpusPsyStep **start, CeltFrame
>>      for (cway = 0; cway < 2; cway++) {
>>          int mag[2];
>>          int base = f->transient ? 120 : 960;
>> -        int i;
>>
>>          for (i = 0; i < 2; i++) {
>>              int c = ff_celt_tf_select[f->size][f->transient][cway][i];
>> --
>> 2.11.0
>>
> 
> LGTM
> 
On 17/10/17 23:59, Rostislav Pehlivanov wrote:
> On 17 October 2017 at 23:11, Mark Thompson <sw@jkqxz.net> wrote:
> 
>> This can trigger a single-byte overread if the codebook has the maximum
>> number of entries.
>>
>> Fixes #6743.
>> ---
>>  libavcodec/vorbis.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
>> index 399020eec5..ce23b947f0 100644
>> --- a/libavcodec/vorbis.c
>> +++ b/libavcodec/vorbis.c
>> @@ -58,7 +58,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes,
>> unsigned num)
>>      uint32_t exit_at_level[33] = { 404 };
>>      unsigned i, j, p, code;
>>
>> -    for (p = 0; (bits[p] == 0) && (p < num); ++p)
>> +    for (p = 0; (p < num) && (bits[p] == 0); ++p)
>>          ;
>>      if (p == num)
>>          return 0;
>> @@ -71,7 +71,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes,
>> unsigned num)
>>
>>      ++p;
>>
>> -    for (i = p; (bits[i] == 0) && (i < num); ++i)
>> +    for (i = p; (i < num) && (bits[i] == 0); ++i)
>>          ;
>>      if (i == num)
>>          return 0;
>> --
>> 2.11.0
>>
> 
> LGTM

Both applied.

Thanks,

- Mark
diff mbox

Patch

diff --git a/libavcodec/opusenc_psy.c b/libavcodec/opusenc_psy.c
index b446d41f75..1b108ecb87 100644
--- a/libavcodec/opusenc_psy.c
+++ b/libavcodec/opusenc_psy.c
@@ -370,7 +370,6 @@  static int celt_search_for_tf(OpusPsyContext *s, OpusPsyStep **start, CeltFrame
     for (cway = 0; cway < 2; cway++) {
         int mag[2];
         int base = f->transient ? 120 : 960;
-        int i;
 
         for (i = 0; i < 2; i++) {
             int c = ff_celt_tf_select[f->size][f->transient][cway][i];