[FFmpeg-devel] [PATCH v2 08/15] avformat/webmdashenc: Don't pass NULL to memcmp

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sat Sep 28 05:26:03 EEST 2019


Affects the FATE-tests webm-dash-manifest-unaligned-video-streams,
webm-dash-manifest and webm-dash-manifest-representations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/webmdashenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index 26b8727304..f2b2fa8593 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -162,7 +162,8 @@ static int bitstream_switching(AVFormatContext *s, AdaptationSet *as) {
             strncmp(gold_track_num->value, track_num->value, strlen(gold_track_num->value)) ||
             gold_par->codec_id != par->codec_id ||
             gold_par->extradata_size != par->extradata_size ||
-            memcmp(gold_par->extradata, par->extradata, par->extradata_size)) {
+            (par->extradata_size > 0 &&
+             memcmp(gold_par->extradata, par->extradata, par->extradata_size))) {
             return 0;
         }
     }
-- 
2.20.1



More information about the ffmpeg-devel mailing list