mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-26 10:20:52 +08:00
lavc/avpacket: check NULL before using the pointer
Need to check NULL before using the pointer Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
@@ -522,11 +522,12 @@ fail:
|
|||||||
|
|
||||||
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)
|
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict)
|
||||||
{
|
{
|
||||||
const uint8_t *end = data + size;
|
const uint8_t *end;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!dict || !data || !size)
|
if (!dict || !data || !size)
|
||||||
return ret;
|
return ret;
|
||||||
|
end = data + size;
|
||||||
if (size && end[-1])
|
if (size && end[-1])
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
while (data < end) {
|
while (data < end) {
|
||||||
|
|||||||
Reference in New Issue
Block a user