summaryrefslogtreecommitdiff
path: root/libs/ffvpx/libavcodec/parser.c
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2022-05-30 14:44:19 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-05-30 14:49:22 -0500
commit8510f335c3ff39c207d8cb906da3eb91cd73d75a (patch)
tree88bc89f66bc6b15e27dab678d34c43aaad75de80 /libs/ffvpx/libavcodec/parser.c
parentf11b40c3ab4a5a766b0b71ab1e9a6199b23bbfeb (diff)
downloadaura-central-8510f335c3ff39c207d8cb906da3eb91cd73d75a.tar.gz
[Libs:ffvpx] Update FFVPX to version 4.2.7
Diffstat (limited to 'libs/ffvpx/libavcodec/parser.c')
-rw-r--r--libs/ffvpx/libavcodec/parser.c88
1 files changed, 3 insertions, 85 deletions
diff --git a/libs/ffvpx/libavcodec/parser.c b/libs/ffvpx/libavcodec/parser.c
index f43b197d5..3e19810a9 100644
--- a/libs/ffvpx/libavcodec/parser.c
+++ b/libs/ffvpx/libavcodec/parser.c
@@ -27,95 +27,10 @@
#include "libavutil/avassert.h"
#include "libavutil/internal.h"
#include "libavutil/mem.h"
-#include "libavutil/thread.h"
#include "internal.h"
#include "parser.h"
-/* Parsers */
-extern AVCodecParser ff_aac_parser;
-extern AVCodecParser ff_aac_latm_parser;
-extern AVCodecParser ff_ac3_parser;
-extern AVCodecParser ff_adx_parser;
-extern AVCodecParser ff_bmp_parser;
-extern AVCodecParser ff_cavsvideo_parser;
-extern AVCodecParser ff_cook_parser;
-extern AVCodecParser ff_dca_parser;
-extern AVCodecParser ff_dirac_parser;
-extern AVCodecParser ff_dnxhd_parser;
-extern AVCodecParser ff_dpx_parser;
-extern AVCodecParser ff_dvaudio_parser;
-extern AVCodecParser ff_dvbsub_parser;
-extern AVCodecParser ff_dvdsub_parser;
-extern AVCodecParser ff_dvd_nav_parser;
-extern AVCodecParser ff_flac_parser;
-extern AVCodecParser ff_g729_parser;
-extern AVCodecParser ff_gsm_parser;
-extern AVCodecParser ff_h261_parser;
-extern AVCodecParser ff_h263_parser;
-extern AVCodecParser ff_h264_parser;
-extern AVCodecParser ff_hevc_parser;
-extern AVCodecParser ff_mjpeg_parser;
-extern AVCodecParser ff_mlp_parser;
-extern AVCodecParser ff_mpeg4video_parser;
-extern AVCodecParser ff_mpegaudio_parser;
-extern AVCodecParser ff_mpegvideo_parser;
-extern AVCodecParser ff_opus_parser;
-extern AVCodecParser ff_png_parser;
-extern AVCodecParser ff_pnm_parser;
-extern AVCodecParser ff_rv30_parser;
-extern AVCodecParser ff_rv40_parser;
-extern AVCodecParser ff_sbc_parser;
-extern AVCodecParser ff_sipr_parser;
-extern AVCodecParser ff_tak_parser;
-extern AVCodecParser ff_vc1_parser;
-extern AVCodecParser ff_vorbis_parser;
-extern AVCodecParser ff_vp3_parser;
-extern AVCodecParser ff_vp8_parser;
-extern AVCodecParser ff_vp9_parser;
-extern AVCodecParser ff_xma_parser;
-
-#include "libavcodec/parser_list.c"
-
-static AVOnce av_parser_next_init = AV_ONCE_INIT;
-
-static void av_parser_init_next(void)
-{
- AVCodecParser *prev = NULL, *p;
- int i = 0;
- while ((p = (AVCodecParser*)parser_list[i++])) {
- if (prev)
- prev->next = p;
- prev = p;
- }
-}
-
-AVCodecParser *av_parser_next(const AVCodecParser *p)
-{
- ff_thread_once(&av_parser_next_init, av_parser_init_next);
-
- if (p)
- return p->next;
- else
- return (AVCodecParser*)parser_list[0];
-}
-
-const AVCodecParser *av_parser_iterate(void **opaque)
-{
- uintptr_t i = (uintptr_t)*opaque;
- const AVCodecParser *p = parser_list[i];
-
- if (p)
- *opaque = (void*)(i + 1);
-
- return p;
-}
-
-void av_register_codec_parser(AVCodecParser *parser)
-{
- ff_thread_once(&av_parser_next_init, av_parser_init_next);
-}
-
AVCodecParserContext *av_parser_init(int codec_id)
{
AVCodecParserContext *s = NULL;
@@ -330,6 +245,9 @@ int ff_combine_frame(ParseContext *pc, int next,
for (; pc->overread > 0; pc->overread--)
pc->buffer[pc->index++] = pc->buffer[pc->overread_index++];
+ if (next > *buf_size)
+ return AVERROR(EINVAL);
+
/* flush remaining if EOF */
if (!*buf_size && next == END_NOT_FOUND)
next = 0;