History

avcodec/dirac_vlc: Fix integer overflow in ff_dirac_golomb_read_32/16bit()

Fixes: left shift of 1073741824 by 1 places cannot be represented in type 'int32_t' (aka 'int') Fixes: 21245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5683334274613248 Change to int16_t suggested by Lynne

Michael Niedermayer committed 6 years ago

Commit cca04361 parent 56b91301 file · +2 −2Browse files

Unified · Split

libavcodec/dirac_vlc.c+2−2
@@ -1095,7 +1095,7 @@ int ff_dirac_golomb_read_16bit(const uint8_t *buf, int bytes, · 1094 unmodified lines
10951095 {
10961096 LUTState lut = ff_dirac_golomb_lut[*buf++];
10971097 int16_t *dst = (int16_t *)_dst, *last = dst + coeffs;
1098− int16_t val = 0;
1098+ uint16_t val = 0;
10991099
11001100 for (int i = 1; i < bytes; i++)
11011101 PROCESS_VALS;
@@ -1115,7 +1115,7 @@ int ff_dirac_golomb_read_32bit(const uint8_t *buf, int bytes, · 13 unmodified lines
11151115 {
11161116 LUTState lut = ff_dirac_golomb_lut[*buf++];
11171117 int32_t *dst = (int32_t *)_dst, *last = dst + coeffs;
1118− int32_t val = 0;
1118+ uint32_t val = 0;
11191119
11201120 for (int i = 1; i < bytes; i++)
11211121 PROCESS_VALS;

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