]> granicus.if.org Git - libvpx/commitdiff
fix peek_si to enable 1 byte show existing frames.
authorJim Bankoski <jimbankoski@google.com>
Thu, 19 Jun 2014 22:10:30 +0000 (15:10 -0700)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Fri, 20 Jun 2014 01:08:52 +0000 (18:08 -0700)
The test for this is in test vector code ( show existing frames will
fail ).  I can't check it in disabled as I'm changing the generic
test code to do this:

https://gerrit.chromium.org/gerrit/#/c/70569/

Change-Id: I5ab324f0cb7df06316a949af0f7fc089f4a3d466

vp9/vp9_dx_iface.c

index 99641f415000763b365772cf2af603fd313cf3a2..3f1be220c3566acde6744ec253f04c6f6d33d5e8 100644 (file)
@@ -102,9 +102,6 @@ static vpx_codec_err_t decoder_peek_si_internal(const uint8_t *data,
                                                 void *decrypt_state) {
   uint8_t clear_buffer[9];
 
-  if (data_sz <= 8)
-    return VPX_CODEC_UNSUP_BITSTREAM;
-
   if (data + data_sz <= data)
     return VPX_CODEC_INVALID_PARAM;
 
@@ -125,12 +122,16 @@ static vpx_codec_err_t decoder_peek_si_internal(const uint8_t *data,
 
     if (frame_marker != VP9_FRAME_MARKER)
       return VPX_CODEC_UNSUP_BITSTREAM;
+
     if (version > 1) return VPX_CODEC_UNSUP_BITSTREAM;
 
     if (vp9_rb_read_bit(&rb)) {  // show an existing frame
       return VPX_CODEC_OK;
     }
 
+    if (data_sz <= 8)
+      return VPX_CODEC_UNSUP_BITSTREAM;
+
     si->is_kf = !vp9_rb_read_bit(&rb);
     if (si->is_kf) {
       const int sRGB = 7;