mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
libavcodec: fix side data split with 0 sized packets
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a1bb0823a9
commit
3230590c5d
@ -259,7 +259,7 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p = pkt->data + pkt->size - 8 - 5;
|
||||
for (i=1; ; i++){
|
||||
size = AV_RB32(p);
|
||||
if (size>INT_MAX || p - pkt->data <= size)
|
||||
if (size>INT_MAX || p - pkt->data < size)
|
||||
return 0;
|
||||
if (p[4]&128)
|
||||
break;
|
||||
@ -273,7 +273,7 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p= pkt->data + pkt->size - 8 - 5;
|
||||
for (i=0; ; i++){
|
||||
size= AV_RB32(p);
|
||||
av_assert0(size<=INT_MAX && p - pkt->data > size);
|
||||
av_assert0(size<=INT_MAX && p - pkt->data >= size);
|
||||
pkt->side_data[i].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->side_data[i].size = size;
|
||||
pkt->side_data[i].type = p[4]&127;
|
||||
|
Loading…
Reference in New Issue
Block a user