decoder: Signal IVD_RES_CHANGED error for change in crop params
IVD_RES_CHANGED was not signaled when crop parameters changed, i.e. display dimensions changed without change in decode dimensions. In such cases, if output buffer was allocated as per the current dimension being decoded, without IVD_RES_CHANGED signalled, there can be an OOB write if the new buffer is smaller than the frame being returned as output Bug: 118399205 Test: vendor Change-Id: Ia750a99cda08a3254a6f8ea8b55d07e655b34d05
This commit is contained in:
parent
1863b7cc03
commit
442a01bf37
1 changed files with 13 additions and 0 deletions
|
|
@ -918,12 +918,25 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
|
|||
ps_dec->u1_res_changed = 1;
|
||||
return IVD_RES_CHANGED;
|
||||
}
|
||||
|
||||
if((ps_dec->i4_header_decoded & 1) && (ps_dec->u2_disp_width != i4_cropped_wd))
|
||||
{
|
||||
ps_dec->u1_res_changed = 1;
|
||||
return IVD_RES_CHANGED;
|
||||
}
|
||||
|
||||
if((ps_dec->i4_header_decoded & 1) && (ps_dec->u2_pic_ht != u2_pic_ht))
|
||||
{
|
||||
ps_dec->u1_res_changed = 1;
|
||||
return IVD_RES_CHANGED;
|
||||
}
|
||||
|
||||
if((ps_dec->i4_header_decoded & 1) && (ps_dec->u2_disp_height != i4_cropped_ht))
|
||||
{
|
||||
ps_dec->u1_res_changed = 1;
|
||||
return IVD_RES_CHANGED;
|
||||
}
|
||||
|
||||
/* Check for unsupported resolutions */
|
||||
if((u2_pic_wd > H264_MAX_FRAME_WIDTH) || (u2_pic_ht > H264_MAX_FRAME_HEIGHT))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue