]> git.sesse.net Git - ffmpeg/commitdiff
avformat/webmdashenc: Don't pass NULL to memcmp
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 23 Sep 2019 21:23:10 +0000 (23:23 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sun, 28 Mar 2021 15:50:17 +0000 (17:50 +0200)
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@gmail.com>
libavformat/webmdashenc.c

index 332d0466e1473f5d8b0948f375d56661dd2e8b17..1304c1a8c3c2f597252152f721ec638c8c8cd3d4 100644 (file)
@@ -155,7 +155,8 @@ static int bitstream_switching(AVFormatContext *s, const AdaptationSet *as)
             !av_strstart(track_num->value, gold_track_num->value, NULL) ||
             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;
         }
     }