1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00

avcodec/speexdec: relax the extradata check for the speex string

There could be bogus bytes at the start, as is the case of
vp5/potter512-400-partial.avi from the FATE suite, which could be a case of bad
remuxing from an OGG source.

Partially fixes decoding of vp5/potter512-400-partial.avi

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-01-19 22:34:28 -03:00
parent 0f4a72b22b
commit cad35f0a77

View File

@ -52,6 +52,7 @@
*/
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/float_dsp.h"
#include "avcodec.h"
#include "bytestream.h"
@ -1397,9 +1398,9 @@ static int parse_speex_extradata(AVCodecContext *avctx,
const uint8_t *extradata, int extradata_size)
{
SpeexContext *s = avctx->priv_data;
const uint8_t *buf = extradata;
const uint8_t *buf = av_strnstr(extradata, "Speex ", extradata_size);
if (memcmp(buf, "Speex ", 8))
if (!buf)
return AVERROR_INVALIDDATA;
buf += 28;