History

avcodec/pnmdec: Use unsigned for maxval rescaling

Fixes: signed integer overflow: 65535 * 55335 cannot be represented in type 'int' Fixes: 21955/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5669206981083136

Michael Niedermayer committed 6 years ago

Commit 49459ac1 parent 1d633e61 file · +1 −1Browse files

Unified · Split

libavcodec/pnmdec.c+1−1
@@ -132,7 +132,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, · 131 unmodified lines
132132 init_put_bits(&pb, ptr, linesize);
133133 for(j=0; j<avctx->width * components; j++){
134134 unsigned int c=0;
135− int v=0;
135+ unsigned v=0;
136136 if(s->type < 4)
137137 while(s->bytestream < s->bytestream_end && (*s->bytestream < '0' || *s->bytestream > '9' ))
138138 s->bytestream++;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t