mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 07:08:23 +00:00
wavpackparse: Fix potential integer overflow on ID_ODD_SIZE blocks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6564>
This commit is contained in:
parent
18548cdd76
commit
6953204a9c
1 changed files with 4 additions and 1 deletions
|
@ -322,8 +322,11 @@ gst_wavpack_parse_frame_metadata (GstWavpackParse * parse, GstBuffer * buf,
|
||||||
size <<= 8;
|
size <<= 8;
|
||||||
size += c;
|
size += c;
|
||||||
size <<= 1;
|
size <<= 1;
|
||||||
if (id & ID_ODD_SIZE)
|
if (id & ID_ODD_SIZE) {
|
||||||
|
if (size == 0)
|
||||||
|
goto read_failed;
|
||||||
size--;
|
size--;
|
||||||
|
}
|
||||||
|
|
||||||
CHECK (gst_byte_reader_get_data (&br, size + (size & 1), &data));
|
CHECK (gst_byte_reader_get_data (&br, size + (size & 1), &data));
|
||||||
gst_byte_reader_init (&mbr, data, size);
|
gst_byte_reader_init (&mbr, data, size);
|
||||||
|
|
Loading…
Reference in a new issue