summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-09-07 12:40:22 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-09-07 12:40:22 -0700
commit883c0aeb48c63785d7c58b6f1e5212da3eb8475f (patch)
tree5ca6c3e6cce4fd1fce2c153b09bc2fb7b9741cd2
parent2246e67d67f7c22d496c5e02d4d272ef0c425560 (diff)
parentca3b04f17f2ec6efb3a853b1d9aa8643a461ef36 (diff)
downloadandroid_external_libvpx-883c0aeb48c63785d7c58b6f1e5212da3eb8475f.tar.gz
android_external_libvpx-883c0aeb48c63785d7c58b6f1e5212da3eb8475f.tar.bz2
android_external_libvpx-883c0aeb48c63785d7c58b6f1e5212da3eb8475f.zip
Merge tag 'android-6.0.1_r66' into HEAD
Android 6.0.1 release 66 # gpg: Signature made Tue 06 Sep 2016 09:26:27 AM PDT using DSA key ID 9AB10E78 # gpg: Can't check signature: public key not found
-rw-r--r--libvpx/vp9/vp9_dx_iface.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/libvpx/vp9/vp9_dx_iface.c b/libvpx/vp9/vp9_dx_iface.c
index 96ede3c..4eb2fb0 100644
--- a/libvpx/vp9/vp9_dx_iface.c
+++ b/libvpx/vp9/vp9_dx_iface.c
@@ -174,7 +174,7 @@ static vpx_codec_err_t decoder_peek_si_internal(const uint8_t *data,
vpx_decrypt_cb decrypt_cb,
void *decrypt_state) {
int intra_only_flag = 0;
- uint8_t clear_buffer[9];
+ uint8_t clear_buffer[10];
if (data + data_sz <= data)
return VPX_CODEC_INVALID_PARAM;
@@ -188,6 +188,11 @@ static vpx_codec_err_t decoder_peek_si_internal(const uint8_t *data,
data = clear_buffer;
}
+ // A maximum of 6 bits are needed to read the frame marker, profile and
+ // show_existing_frame.
+ if (data_sz < 1)
+ return VPX_CODEC_UNSUP_BITSTREAM;
+
{
int show_frame;
int error_resilient;
@@ -201,15 +206,19 @@ static vpx_codec_err_t decoder_peek_si_internal(const uint8_t *data,
if (profile >= MAX_PROFILES)
return VPX_CODEC_UNSUP_BITSTREAM;
- if ((profile >= 2 && data_sz <= 1) || data_sz < 1)
- return VPX_CODEC_UNSUP_BITSTREAM;
-
if (vpx_rb_read_bit(&rb)) { // show an existing frame
+ // If profile is > 2 and show_existing_frame is true, then at least 1 more
+ // byte (6+3=9 bits) is needed.
+ if (profile > 2 && data_sz < 2)
+ return VPX_CODEC_UNSUP_BITSTREAM;
vpx_rb_read_literal(&rb, 3); // Frame buffer to show.
return VPX_CODEC_OK;
}
- if (data_sz <= 8)
+ // For the rest of the function, a maximum of 9 more bytes are needed
+ // (computed by taking the maximum possible bits needed in each case). Note
+ // that this has to be updated if we read any more bits in this function.
+ if (data_sz < 10)
return VPX_CODEC_UNSUP_BITSTREAM;
si->is_kf = !vpx_rb_read_bit(&rb);