summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRitu Baldwa <ritu.baldwa@ittiam.com>2017-12-27 17:45:30 +0530
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-01-18 19:07:13 +0000
commita7f41c5d3425dbd89da38a4aa8398cf7351406e8 (patch)
tree234c70774f703a5aa6f5472932e492bcb64b8aca
parent7c95c8c1c8273af0dc0c3f481f263c2a35650abb (diff)
downloadandroid_external_libavc-a7f41c5d3425dbd89da38a4aa8398cf7351406e8.tar.gz
android_external_libavc-a7f41c5d3425dbd89da38a4aa8398cf7351406e8.tar.bz2
android_external_libavc-a7f41c5d3425dbd89da38a4aa8398cf7351406e8.zip
Decoder: Fixed memory overflow in shared display mode.
The factor multiplication should happen only at the source, not at the destination. Bug: 71375536 Test: manual Change-Id: Ib5f00b87150a0533880346fac5464b0b1a802c36 (cherry picked from commit c3b026a87d7da17ca5196e1973137b8691e60bde)
-rw-r--r--decoder/ih264d_utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/decoder/ih264d_utils.c b/decoder/ih264d_utils.c
index e85daba..edfb8f1 100644
--- a/decoder/ih264d_utils.c
+++ b/decoder/ih264d_utils.c
@@ -1020,12 +1020,15 @@ WORD32 ih264d_get_next_display_field(dec_struct_t * ps_dec,
buf = ps_dec->disp_bufs[i].buf[1];
buf += ps_dec->disp_bufs[i].u4_ofst[1];
pv_disp_op->s_disp_frm_buf.pv_u_buf = buf
- + pic_buf->u2_crop_offset_uv;
+ + (pic_buf->u2_crop_offset_uv
+ / YUV420SP_FACTOR);
buf = ps_dec->disp_bufs[i].buf[2];
buf += ps_dec->disp_bufs[i].u4_ofst[2];
pv_disp_op->s_disp_frm_buf.pv_v_buf = buf
- + pic_buf->u2_crop_offset_uv;
+ + (pic_buf->u2_crop_offset_uv
+ / YUV420SP_FACTOR);
+
}
}
}