History

mjpegbdec: Fix incorrect bitstream buffer size.

Fixes CVE-2011-3947

Michael Niedermayer committed 14 years ago

Commit 01e5e971 parent dd453f11 file · +1 −2Browse files

Unified · Split

libavcodec/mjpegbdec.c+1−2
@@ -111,8 +111,7 @@ read_header: · 110 unmodified lines
111111 av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs);
112112 if (sos_offs)
113113 {
114−// init_get_bits(&s->gb, buf+sos_offs, (buf_end - (buf+sos_offs))*8);
115− init_get_bits(&s->gb, buf_ptr+sos_offs, field_size*8);
114+ init_get_bits(&s->gb, buf_ptr+sos_offs, FFMIN(field_size, buf_end - (buf_ptr+sos_offs))*8);
116115 s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
117116 s->start_code = SOS;
118117 if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 &&

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