[FFmpeg-cvslog] libavcodec: fix side data split with 0 sized packets
Michael Niedermayer
git at videolan.org
Mon May 21 21:29:58 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon May 21 20:16:35 2012 +0200| [3230590c5dba41fcfbf27804b79ae5689bc2b413] | committer: Michael Niedermayer
libavcodec: fix side data split with 0 sized packets
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3230590c5dba41fcfbf27804b79ae5689bc2b413
---
libavcodec/avpacket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index a8e5c64..612f02d 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list