avfilter/ebur128: do not allow null ebur128 context in ff_ebur128_relative_threshold
authorMarton Balint <cus@passwd.hu>
Wed, 25 Jan 2017 00:06:42 +0000 (01:06 +0100)
committerMarton Balint <cus@passwd.hu>
Sat, 4 Feb 2017 22:54:17 +0000 (23:54 +0100)
The user should supply a proper context.

Fixes Coverity CID 1396246.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavfilter/ebur128.c

index a46692e..012df54 100644 (file)
@@ -599,7 +599,7 @@ int ff_ebur128_relative_threshold(FFEBUR128State * st, double *out)
     double relative_threshold;
     size_t above_thresh_counter;
 
-    if (st && (st->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I)
+    if ((st->mode & FF_EBUR128_MODE_I) != FF_EBUR128_MODE_I)
         return AVERROR(EINVAL);
 
     ebur128_calc_relative_threshold(st, &above_thresh_counter,