mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-11-01 13:03:55 +08:00
[mpp_meta]: Clear value on get_env failed
NOTE: s32 and s64 value can not be cleared to zero for it may have initialized invalid value. Change-Id: Iea9f36600b051584de34d8ac1782a897c64dcd2f Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -448,9 +448,8 @@ MPP_RET mpp_meta_get_ptr(MppMeta meta, MppMetaKey key, void **val)
|
||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||
MppMetaVal meta_val;
|
||||
MPP_RET ret = get_val_by_key(impl, key, TYPE_PTR, &meta_val);
|
||||
if (MPP_OK == ret)
|
||||
*val = meta_val.val_ptr;
|
||||
|
||||
*val = (ret) ? NULL : meta_val.val_ptr;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -503,9 +502,8 @@ MPP_RET mpp_meta_get_frame(MppMeta meta, MppMetaKey key, MppFrame *frame)
|
||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||
MppMetaVal meta_val;
|
||||
MPP_RET ret = get_val_by_key(impl, key, TYPE_FRAME, &meta_val);
|
||||
if (MPP_OK == ret)
|
||||
*frame = meta_val.frame;
|
||||
|
||||
*frame = (ret) ? NULL : meta_val.frame;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -519,9 +517,8 @@ MPP_RET mpp_meta_get_packet(MppMeta meta, MppMetaKey key, MppPacket *packet)
|
||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||
MppMetaVal meta_val;
|
||||
MPP_RET ret = get_val_by_key(impl, key, TYPE_PACKET, &meta_val);
|
||||
if (MPP_OK == ret)
|
||||
*packet = meta_val.packet;
|
||||
|
||||
*packet = (ret) ? NULL : meta_val.packet;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -535,9 +532,8 @@ MPP_RET mpp_meta_get_buffer(MppMeta meta, MppMetaKey key, MppBuffer *buffer)
|
||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||
MppMetaVal meta_val;
|
||||
MPP_RET ret = get_val_by_key(impl, key, TYPE_BUFFER, &meta_val);
|
||||
if (MPP_OK == ret)
|
||||
*buffer = meta_val.buffer;
|
||||
|
||||
*buffer = (ret) ? NULL : meta_val.buffer;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user