aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-12-14 23:19:26 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-20 02:46:10 +0200
commite7b36268be1305242a835d0e5771430ea463d8d2 (patch)
treec0dbf06b93e81068cb66f228d249c8c10d33703e
parent95d2ae971000d5388bdec996eb7aacc627d5a997 (diff)
downloadffmpeg-e7b36268be1305242a835d0e5771430ea463d8d2.tar.gz
dump_extradata: Insert extradata even for small packets
3469cfab added a check for whether the extradata coincided with the beginning of the packet's data in order not to add extradata to packets that already have it. But the check used was buggy for packets whose size is smaller than the extradata's size. This commit fixes this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a88a3cdb4b166c83b823d34abe8a7a6743c7ebd5)
-rw-r--r--libavcodec/dump_extradata_bsf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/dump_extradata_bsf.c b/libavcodec/dump_extradata_bsf.c
index b641508234..0b6d404792 100644
--- a/libavcodec/dump_extradata_bsf.c
+++ b/libavcodec/dump_extradata_bsf.c
@@ -51,8 +51,8 @@ static int dump_extradata(AVBSFContext *ctx, AVPacket *out)
if (ctx->par_in->extradata &&
(s->freq == DUMP_FREQ_ALL ||
(s->freq == DUMP_FREQ_KEYFRAME && in->flags & AV_PKT_FLAG_KEY)) &&
- in->size >= ctx->par_in->extradata_size &&
- memcmp(in->data, ctx->par_in->extradata, ctx->par_in->extradata_size)) {
+ (in->size < ctx->par_in->extradata_size ||
+ memcmp(in->data, ctx->par_in->extradata, ctx->par_in->extradata_size))) {
if (in->size >= INT_MAX - ctx->par_in->extradata_size) {
ret = AVERROR(ERANGE);
goto fail;