Commit 49a76560 authored by David Barker's avatar David Barker Committed by Yaowu Xu
Browse files

Fix segfault for reference-buffer&aom-highbitdepth

The commit fixes the segfault shown in  test AV1/ActiveMapTestLarge
when build with the following config:
../../aom/configure --disable-install-docs --enable-unit-tests
--enable-debug --disable-optimizations --enable-aom-highbitdepth
--enable-experimental --enable-ans --enable-bidir-pred
--enable-dual-filter --enable-entropy --enable-ext-inter
--enable-ext-interp --enable-ext-intra --enable-ext-partition
--enable-ext-partition-types --enable-ext-refs --enable-ext-tx
--enable-loop-restoration --enable-filter-intra --enable-motion-var
--enable-new-quant --enable-ref-mv --enable-supertx --enable-var-tx

BUG=aomedia:99

Change-Id: I900d5e1d5458c482a1f0a3dde769c1ad93acdca7
parent 1ee98b6c
...@@ -4655,15 +4655,20 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size, ...@@ -4655,15 +4655,20 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
{ {
/* Non-normative definition of current_frame_id ("frame counter" with /* Non-normative definition of current_frame_id ("frame counter" with
* wraparound) */ * wraparound) */
int FidLen = FRAME_ID_LENGTH_MINUS7 + 7; const int FidLen = FRAME_ID_LENGTH_MINUS7 + 7;
if (cm->current_frame_id == -1) { if (cm->current_frame_id == -1) {
int lsb, msb;
/* quasi-random initialization of current_frame_id for a key frame */ /* quasi-random initialization of current_frame_id for a key frame */
#if CONFIG_AOM_HIGHBITDEPTH #if CONFIG_AOM_HIGHBITDEPTH
int lsb = CONVERT_TO_SHORTPTR(cpi->Source->y_buffer)[0] & 0xff; if (cpi->Source->flags & YV12_FLAG_HIGHBITDEPTH) {
int msb = CONVERT_TO_SHORTPTR(cpi->Source->y_buffer)[1] & 0xff; lsb = CONVERT_TO_SHORTPTR(cpi->Source->y_buffer)[0] & 0xff;
#else msb = CONVERT_TO_SHORTPTR(cpi->Source->y_buffer)[1] & 0xff;
int lsb = cpi->Source->y_buffer[0]; } else {
int msb = cpi->Source->y_buffer[1]; #endif
lsb = cpi->Source->y_buffer[0] & 0xff;
msb = cpi->Source->y_buffer[1] & 0xff;
#if CONFIG_AOM_HIGHBITDEPTH
}
#endif #endif
cm->current_frame_id = ((msb << 8) + lsb) % (1 << FidLen); cm->current_frame_id = ((msb << 8) + lsb) % (1 << FidLen);
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment