cast-char-to-uint-before-shift.patch 872 B

1234567891011121314151617181920212223242526272829
  1. # HG changeset patch
  2. # User Gerald Squelart <gsquelart@mozilla.com>
  3. # Parent 3d0a39b9f8cd9b07dac0263cfbaa23649d8b3138
  4. Bug 1224371 - Cast uint8_t to uint32_t before shift - r=jya
  5. Note: C-style cast because it is C code.
  6. diff --git a/media/libvpx/vp9/decoder/vp9_decoder.c b/media/libvpx/vp9/decoder/vp9_decoder.c
  7. --- a/media/libvpx/vp9/decoder/vp9_decoder.c
  8. +++ b/media/libvpx/vp9/decoder/vp9_decoder.c
  9. @@ -494,16 +494,16 @@ vpx_codec_err_t vp9_parse_superframe_ind
  10. decrypt_cb(decrypt_state, x, clear_buffer, frames * mag);
  11. x = clear_buffer;
  12. }
  13. for (i = 0; i < frames; ++i) {
  14. uint32_t this_sz = 0;
  15. for (j = 0; j < mag; ++j)
  16. - this_sz |= (*x++) << (j * 8);
  17. + this_sz |= (uint32_t)(*x++) << (j * 8);
  18. sizes[i] = this_sz;
  19. }
  20. *count = frames;
  21. }
  22. }
  23. return VPX_CODEC_OK;
  24. }