diff mbox

[FFmpeg-devel] avcodec/ylc: Fix vlc of 31 bits

Message ID 20170708205157.11201-1-michael@niedermayer.cc
State Accepted
Commit fe9242204d33db070b8a9d907d93c9ead8a6f3ee
Headers show

Commit Message

Michael Niedermayer July 8, 2017, 8:51 p.m. UTC
Fixes: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Fixes: 2515/clusterfuzz-testcase-minimized-6197200012967936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/ylc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol July 8, 2017, 8:59 p.m. UTC | #1
On 7/8/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Fixes: runtime error: left shift of 1 by 31 places cannot be represented in
> type 'int'
> Fixes: 2515/clusterfuzz-testcase-minimized-6197200012967936
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/ylc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

ok
Michael Niedermayer July 8, 2017, 9:21 p.m. UTC | #2
On Sat, Jul 08, 2017 at 10:59:02PM +0200, Paul B Mahol wrote:
> On 7/8/17, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Fixes: runtime error: left shift of 1 by 31 places cannot be represented in
> > type 'int'
> > Fixes: 2515/clusterfuzz-testcase-minimized-6197200012967936
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavcodec/ylc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> 
> ok

will apply

thx

[...]
diff mbox

Patch

diff --git a/libavcodec/ylc.c b/libavcodec/ylc.c
index bf55e37be1..ae46b3b8c2 100644
--- a/libavcodec/ylc.c
+++ b/libavcodec/ylc.c
@@ -69,7 +69,7 @@  static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat,
 
     s = nodes[node].sym;
     if (s != -1) {
-        bits[*pos] = (~pfx) & ((1 << FFMAX(pl, 1)) - 1);
+        bits[*pos] = (~pfx) & ((1U << FFMAX(pl, 1)) - 1);
         lens[*pos] = FFMAX(pl, 1);
         xlat[*pos] = s + (pl == 0);
         (*pos)++;