Loading media/codec2/components/apv/C2SoftApvDec.cpp +11 −2 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,8 @@ const char* MEDIA_MIMETYPE_VIDEO_APV = "video/apv"; #define MAX_NUM_FRMS (1) // supports only 1-frame output #define MAX_NUM_FRMS (1) // supports only 1-frame output #define FRM_IDX (0) // supports only 1-frame output #define FRM_IDX (0) // supports only 1-frame output #define MAX_SUPPORTED_WIDTH (4096) #define MAX_SUPPORTED_HEIGHT (4096) // check generic frame or not // check generic frame or not #define IS_NON_AUX_FRM(frm) \ #define IS_NON_AUX_FRM(frm) \ (((frm)->pbu_type == OAPV_PBU_TYPE_PRIMARY_FRAME) || \ (((frm)->pbu_type == OAPV_PBU_TYPE_PRIMARY_FRAME) || \ Loading Loading @@ -76,8 +78,8 @@ class C2SoftApvDec::IntfImpl : public SimpleInterface<void>::BaseParams { addParameter(DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) addParameter(DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withFields({ .withFields({ C2F(mSize, width).inRange(2, 4096), C2F(mSize, width).inRange(2, MAX_SUPPORTED_WIDTH), C2F(mSize, height).inRange(2, 4096), C2F(mSize, height).inRange(2, MAX_SUPPORTED_HEIGHT), }) }) .withSetter(SizeSetter) .withSetter(SizeSetter) .build()); .build()); Loading Loading @@ -945,6 +947,7 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work, if (OAPV_FAILED(oapvd_info(bitb.addr, bitb.ssize, &aui))) { if (OAPV_FAILED(oapvd_info(bitb.addr, bitb.ssize, &aui))) { ALOGE("cannot get information from bitstream"); ALOGE("cannot get information from bitstream"); work->result = C2_CORRUPTED; return; return; } } Loading @@ -965,6 +968,12 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work, mHeight = finfo->h; mHeight = finfo->h; } } if (mWidth > MAX_SUPPORTED_WIDTH || mHeight > MAX_SUPPORTED_HEIGHT) { ALOGE("Stream resolution of %dx%d is not supported.", mWidth, mHeight); work->result = C2_CORRUPTED; return; } if (frm->imgb != NULL && (frm->imgb->w[0] != finfo->w || frm->imgb->h[0] != finfo->h)) { if (frm->imgb != NULL && (frm->imgb->w[0] != finfo->w || frm->imgb->h[0] != finfo->h)) { frm->imgb->release(frm->imgb); frm->imgb->release(frm->imgb); frm->imgb = NULL; frm->imgb = NULL; Loading Loading
media/codec2/components/apv/C2SoftApvDec.cpp +11 −2 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,8 @@ const char* MEDIA_MIMETYPE_VIDEO_APV = "video/apv"; #define MAX_NUM_FRMS (1) // supports only 1-frame output #define MAX_NUM_FRMS (1) // supports only 1-frame output #define FRM_IDX (0) // supports only 1-frame output #define FRM_IDX (0) // supports only 1-frame output #define MAX_SUPPORTED_WIDTH (4096) #define MAX_SUPPORTED_HEIGHT (4096) // check generic frame or not // check generic frame or not #define IS_NON_AUX_FRM(frm) \ #define IS_NON_AUX_FRM(frm) \ (((frm)->pbu_type == OAPV_PBU_TYPE_PRIMARY_FRAME) || \ (((frm)->pbu_type == OAPV_PBU_TYPE_PRIMARY_FRAME) || \ Loading Loading @@ -76,8 +78,8 @@ class C2SoftApvDec::IntfImpl : public SimpleInterface<void>::BaseParams { addParameter(DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) addParameter(DefineParam(mSize, C2_PARAMKEY_PICTURE_SIZE) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withDefault(new C2StreamPictureSizeInfo::output(0u, 320, 240)) .withFields({ .withFields({ C2F(mSize, width).inRange(2, 4096), C2F(mSize, width).inRange(2, MAX_SUPPORTED_WIDTH), C2F(mSize, height).inRange(2, 4096), C2F(mSize, height).inRange(2, MAX_SUPPORTED_HEIGHT), }) }) .withSetter(SizeSetter) .withSetter(SizeSetter) .build()); .build()); Loading Loading @@ -945,6 +947,7 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work, if (OAPV_FAILED(oapvd_info(bitb.addr, bitb.ssize, &aui))) { if (OAPV_FAILED(oapvd_info(bitb.addr, bitb.ssize, &aui))) { ALOGE("cannot get information from bitstream"); ALOGE("cannot get information from bitstream"); work->result = C2_CORRUPTED; return; return; } } Loading @@ -965,6 +968,12 @@ void C2SoftApvDec::process(const std::unique_ptr<C2Work>& work, mHeight = finfo->h; mHeight = finfo->h; } } if (mWidth > MAX_SUPPORTED_WIDTH || mHeight > MAX_SUPPORTED_HEIGHT) { ALOGE("Stream resolution of %dx%d is not supported.", mWidth, mHeight); work->result = C2_CORRUPTED; return; } if (frm->imgb != NULL && (frm->imgb->w[0] != finfo->w || frm->imgb->h[0] != finfo->h)) { if (frm->imgb != NULL && (frm->imgb->w[0] != finfo->w || frm->imgb->h[0] != finfo->h)) { frm->imgb->release(frm->imgb); frm->imgb->release(frm->imgb); frm->imgb = NULL; frm->imgb = NULL; Loading