summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-08-09 03:11:05 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-08-09 03:11:05 +0000
commit709ec74f1ce3d56afa192d64c39e36762b7e95ad (patch)
tree73bba423ccc002934ce3239783fc8922cc0a458f
parent8784f762582d6775fb0bd800c4657506c8812b21 (diff)
parenta88271009422ebb38e087dd81a986c07e98b7b77 (diff)
downloadlibmpeg2-pie-qpr1-release.tar.gz
Change-Id: I040c32175de9a31f9be5597212394b4f46b3164c
-rw-r--r--decoder/impeg2d_dec_hdr.c14
-rw-r--r--decoder/impeg2d_decoder.c6
2 files changed, 16 insertions, 4 deletions
diff --git a/decoder/impeg2d_dec_hdr.c b/decoder/impeg2d_dec_hdr.c
index e899347..c4fcee5 100644
--- a/decoder/impeg2d_dec_hdr.c
+++ b/decoder/impeg2d_dec_hdr.c
@@ -167,10 +167,6 @@ IMPEG2D_ERROR_CODES_T impeg2d_dec_seq_hdr(dec_state_t *ps_dec)
/* This is the first time we are reading the resolution */
ps_dec->u2_horizontal_size = u2_width;
ps_dec->u2_vertical_size = u2_height;
- if (0 == ps_dec->u4_frm_buf_stride)
- {
- ps_dec->u4_frm_buf_stride = (UWORD32) (u2_width);
- }
}
else
{
@@ -193,6 +189,11 @@ IMPEG2D_ERROR_CODES_T impeg2d_dec_seq_hdr(dec_state_t *ps_dec)
return e_error;
}
+ else if((ps_dec->u2_horizontal_size < MIN_WIDTH)
+ || (ps_dec->u2_vertical_size < MIN_HEIGHT))
+ {
+ return IMPEG2D_UNSUPPORTED_DIMENSIONS;
+ }
else
{
/* The resolution has changed */
@@ -210,6 +211,11 @@ IMPEG2D_ERROR_CODES_T impeg2d_dec_seq_hdr(dec_state_t *ps_dec)
return e_error;
}
+ if((ps_dec->u2_horizontal_size < MIN_WIDTH)
+ || (ps_dec->u2_vertical_size < MIN_HEIGHT))
+ {
+ return IMPEG2D_UNSUPPORTED_DIMENSIONS;
+ }
/*------------------------------------------------------------------------*/
/* Flush the following as they are not being used */
diff --git a/decoder/impeg2d_decoder.c b/decoder/impeg2d_decoder.c
index bff8c21..726d9cd 100644
--- a/decoder/impeg2d_decoder.c
+++ b/decoder/impeg2d_decoder.c
@@ -155,6 +155,12 @@ void impeg2d_dec_hdr(void *pv_dec,impeg2d_video_decode_ip_t *ps_ip,
ps_op->s_ivd_video_decode_op_t.u4_num_bytes_consumed = ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes;
}
ps_op->s_ivd_video_decode_op_t.u4_frame_decoded_flag = 0;
+
+ /* Set the stride */
+ if (0 == ps_dec->u4_frm_buf_stride)
+ {
+ ps_dec->u4_frm_buf_stride = ps_dec->u2_horizontal_size;
+ }
/* MOD */
ps_dec->u2_header_done = 1;