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
1095{1095{
1096 LUTState lut = ff_dirac_golomb_lut[*buf++];1096 LUTState lut = ff_dirac_golomb_lut[*buf++];
1097 int16_t *dst = (int16_t *)_dst, *last = dst + coeffs;1097 int16_t *dst = (int16_t *)_dst, *last = dst + coeffs;
1098 int16_t val = 0;1098 uint16_t val = 0;
1099 1099
1100 for (int i = 1; i < bytes; i++)1100 for (int i = 1; i < bytes; i++)
1101 PROCESS_VALS;1101 PROCESS_VALS;
@@ -1115,7 +1115,7 @@ int ff_dirac_golomb_read_32bit(const uint8_t *buf, int bytes, · 13 unmodified lines
1115{1115{
1116 LUTState lut = ff_dirac_golomb_lut[*buf++];1116 LUTState lut = ff_dirac_golomb_lut[*buf++];
1117 int32_t *dst = (int32_t *)_dst, *last = dst + coeffs;1117 int32_t *dst = (int32_t *)_dst, *last = dst + coeffs;
1118 int32_t val = 0;1118 uint32_t val = 0;
1119 1119
1120 for (int i = 1; i < bytes; i++)1120 for (int i = 1; i < bytes; i++)
1121 PROCESS_VALS;1121 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