Fixes: signed integer overflow: 65535 * 55335 cannot be represented in type 'int' Fixes: 21955/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5669206981083136
Unified · Split
| @@ -132,7 +132,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, · 131 unmodified lines | |||
| 132 | init_put_bits(&pb, ptr, linesize); | 132 | init_put_bits(&pb, ptr, linesize); |
| 133 | for(j=0; j<avctx->width * components; j++){ | 133 | for(j=0; j<avctx->width * components; j++){ |
| 134 | unsigned int c=0; | 134 | unsigned int c=0; |
| 135 | int v=0; | 135 | unsigned v=0; |
| 136 | if(s->type < 4) | 136 | if(s->type < 4) |
| 137 | while(s->bytestream < s->bytestream_end && (*s->bytestream < '0' || *s->bytestream > '9' )) | 137 | while(s->bytestream < s->bytestream_end && (*s->bytestream < '0' || *s->bytestream > '9' )) |
| 138 | s->bytestream++; | 138 | s->bytestream++; |