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

Submitted by Andreas Rheinhardt on Sept. 28, 2019, 2:26 a.m.

Details

Message ID 20190928022610.5903-8-andreas.rheinhardt@gmail.com
State New
Headers show

Commit Message

Andreas Rheinhardt Sept. 28, 2019, 2:26 a.m.
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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;
         }
     }