Casting int64_t to void* may truncate the value in 32-bit builds |
|||
Issue description
In media/filters/aom_video_decoder.cc, we pass an int64_t timestamp
as the user_priv argument to aom_codec_decode(). This requires casting
an int64_t value to a void* pointer:
bool AomVideoDecoder::DecodeBuffer(const DecoderBuffer* buffer) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!buffer->end_of_stream());
if (aom_codec_decode(
aom_decoder_.get(), buffer->data(), buffer->data_size(),
reinterpret_cast<void*>(buffer->timestamp().InMicroseconds())) !=
AOM_CODEC_OK) {
In a 32-bit build, a void* pointer is 32 bits, so the cast to void* may
potentially truncate the int64_t timestamp.
Dale, is it possible for buffer->timestamp().InMicroseconds() to be
greater than or equal to 2^32?
Do you have any suggestions on how to fix this? Thanks.
,
Oct 30
I'm already trying something similar in another experiment: https://chromium-review.googlesource.com/c/chromium/src/+/1303406/1/media/filters/dav1d_video_decoder.cc#191
,
Nov 2
,
Nov 3
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/68a3b425ac9cc520cefb62a2adf673c8b94d8bb6 commit 68a3b425ac9cc520cefb62a2adf673c8b94d8bb6 Author: Dale Curtis <dalecurtis@chromium.org> Date: Sat Nov 03 02:01:51 2018 Switch AomVideoDecoder to zero copy now that libaom fixes are in. libaom has fixed all the framebuffer issues, so we should now be able to use these. All tests pass and YouTube videos look good. Seems only a minor memory savings ~2mb on a 480p clip. This also resolves an issue with clipping of 64-bit timestamps passed in as a void* (which might be 32-bit on some platforms). BUG= 867613 , 900302 TEST=existing tests all still pass. Change-Id: I83af8ecd867e13741f27f5225316b62f31981562 Reviewed-on: https://chromium-review.googlesource.com/c/1316408 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Thomas Guilbert <tguilbert@chromium.org> Cr-Commit-Position: refs/heads/master@{#605129} [modify] https://crrev.com/68a3b425ac9cc520cefb62a2adf673c8b94d8bb6/media/filters/aom_video_decoder.cc [modify] https://crrev.com/68a3b425ac9cc520cefb62a2adf673c8b94d8bb6/media/filters/aom_video_decoder.h
,
Nov 5
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dalecur...@chromium.org
, Oct 30