From db300ca1de320ce32decb62e6bd97f1ba14290c4 Mon Sep 17 00:00:00 2001 From: Peng Yixin Date: Wed, 13 Jun 2018 19:40:10 +0800 Subject: [PATCH] media_module: fix issue on h265 PD#167443: 1.fix allocate memory fail: add a judgment statement about the width and height of video. 2.add code to put mv buffer when already got mv buffer and allocation mmu memory failure. Change-Id: I9934716cbe0157b02b5f64c6a53e73bb8e1d7fc2 Signed-off-by: Peng Yixin --- .../amlogic/media_modules/frame_provider/decoder/h265/vh265.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c b/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c index 40b02e90a71d..a63cfe932d9b 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/h265/vh265.c @@ -4581,6 +4581,7 @@ static struct PIC_s *get_new_pic(struct hevc_state_s *hevc, rpm_param->p.bit_depth, hevc->frame_mmu_map_addr); if (ret != 0) { + put_mv_buf(hevc, new_pic); hevc_print(hevc, 0, "can't alloc need mmu1,idx %d ret =%d\n", new_pic->decode_idx, @@ -8251,7 +8252,8 @@ pic_done: hevc->lcu_size = 1 << (log + 3 + log_s); hevc->lcu_size_log2 = log2i(hevc->lcu_size); if (hevc->pic_w == 0 || hevc->pic_h == 0 - || hevc->lcu_size == 0) { + || hevc->lcu_size == 0 + || OVER_SIZE(hevc->pic_w, hevc->pic_h)) { /* skip search next start code */ WRITE_VREG(HEVC_WAIT_FLAG, READ_VREG(HEVC_WAIT_FLAG) & (~0x2));