mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
openjpeg: guard against invalid memory access on crafted files
This commit is contained in:
parent
e5a0c4a751
commit
903684aa78
1 changed files with 3 additions and 0 deletions
|
@ -1012,6 +1012,9 @@ gst_openjpeg_dec_handle_frame (GstVideoDecoder * decoder,
|
|||
if (!gst_buffer_map (frame->input_buffer, &map, GST_MAP_READ))
|
||||
goto map_read_error;
|
||||
|
||||
if (self->is_jp2c && map.size < 8)
|
||||
goto open_error;
|
||||
|
||||
#ifdef HAVE_OPENJPEG_1
|
||||
io = opj_cio_open ((opj_common_ptr) dec, map.data + (self->is_jp2c ? 8 : 0),
|
||||
map.size - (self->is_jp2c ? 8 : 0));
|
||||
|
|
Loading…
Reference in a new issue