gstreamer/subprojects/gst-plugins-base/ext/ogg/vorbis_parse.h
Matthew Waters 62d09f73b7 ogg: fix possible buffer overrun
If an ogg stream does not match our expectations of how the end of a
buffer may be structured, it was possible to read memory past the end of
the buffer parsed by libogg.  Include a bounds check for this case and
stop parsing.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3930

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2134>
2022-04-08 08:52:45 +00:00

32 lines
1.1 KiB
C

/* GStreamer
* Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
*
* gstoggdemux.c: ogg stream demuxer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_VORBIS_PARSE_H__
#define __GST_VORBIS_PARSE_H__
#include <gst/gst.h>
G_GNUC_INTERNAL
void gst_parse_vorbis_header_packet (GstOggStream * pad, ogg_packet * packet);
G_GNUC_INTERNAL
int gst_parse_vorbis_setup_packet (GstOggStream * pad, ogg_packet * op);
#endif /* __GST_VORBIS_PARSE_H__ */