shithub: libvpx

Download patch

ref: d99a0bc7695659a873672686cd7b05441ecbd17e
parent: 67aa6c8c23bc6ca90cfde756015f0aae61fe20f7
parent: d1e872e1b919759f52f9772fef5a41313aa1b1e8
author: Johann Koenig <johannkoenig@google.com>
date: Wed Dec 18 01:01:54 EST 2019

Merge "vp8: move error check earlier"

--- a/vp8/decoder/dboolhuff.c
+++ b/vp8/decoder/dboolhuff.c
@@ -15,6 +15,8 @@
 int vp8dx_start_decode(BOOL_DECODER *br, const unsigned char *source,
                        unsigned int source_sz, vpx_decrypt_cb decrypt_cb,
                        void *decrypt_state) {
+  if (source_sz && !source) return 1;
+
   // To simplify calling code this fuction can be called with |source| == null
   // and |source_sz| == 0. This and vp8dx_bool_decoder_fill() are essentially
   // no-ops in this case.
@@ -26,8 +28,6 @@
   br->range = 255;
   br->decrypt_cb = decrypt_cb;
   br->decrypt_state = decrypt_state;
-
-  if (source_sz && !source) return 1;
 
   /* Populate the buffer */
   vp8dx_bool_decoder_fill(br);