]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Revert "[libvpx] scan-build: Fix "Dereference of null pointer" in vp8_peek_si_internal"
authorAndrey Volk <andywolk@gmail.com>
Fri, 6 Mar 2020 17:13:50 +0000 (21:13 +0400)
committerAndrey Volk <andywolk@gmail.com>
Fri, 6 Mar 2020 17:13:50 +0000 (21:13 +0400)
This reverts commit 4b971dff75a4ce55d431c778710489f4cdbc2b8d.

libs/libvpx/vp8/vp8_dx_iface.c

index 5e2de6c0e84c50164d166e9325c1f339556aa0ff..f20283c1e1b9d48467f7fec5375d16a7f98434d5 100644 (file)
@@ -117,17 +117,11 @@ static vpx_codec_err_t vp8_destroy(vpx_codec_alg_priv_t *ctx) {
   return VPX_CODEC_OK;
 }
 
-#ifdef __clang_analyzer__
-#define FUNC_ATTR_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
-#else
-#define FUNC_ATTR_NONNULL(...)
-#endif
-
 static vpx_codec_err_t vp8_peek_si_internal(const uint8_t *data,
                                             unsigned int data_sz,
                                             vpx_codec_stream_info_t *si,
                                             vpx_decrypt_cb decrypt_cb,
-                                            void *decrypt_state) FUNC_ATTR_NONNULL(1) {
+                                            void *decrypt_state) {
   vpx_codec_err_t res = VPX_CODEC_OK;
 
   assert(data != NULL);
@@ -273,7 +267,7 @@ static int update_fragments(vpx_codec_alg_priv_t *ctx, const uint8_t *data,
 static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
                                   const uint8_t *data, unsigned int data_sz,
                                   void *user_priv, long deadline) {
-  volatile vpx_codec_err_t res = VPX_CODEC_INVALID_PARAM;
+  volatile vpx_codec_err_t res;
   unsigned int resolution_change = 0;
   unsigned int w, h;
 
@@ -291,10 +285,8 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
   w = ctx->si.w;
   h = ctx->si.h;
 
-  if (ctx->fragments.ptrs[0]) {
-      res = vp8_peek_si_internal(ctx->fragments.ptrs[0], ctx->fragments.sizes[0],
+  res = vp8_peek_si_internal(ctx->fragments.ptrs[0], ctx->fragments.sizes[0],
                              &ctx->si, ctx->decrypt_cb, ctx->decrypt_state);
-  }
 
   if ((res == VPX_CODEC_UNSUP_BITSTREAM) && !ctx->si.is_kf) {
     /* the peek function returns an error for non keyframes, however for