Browse Source

swfdec: check space before copy

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
abe68364a3
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/swfdec.c

+ 5
- 0
libavformat/swfdec.c View File

@@ -362,6 +362,11 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
default:
av_assert0(0);
}

if (linesize * height > pkt->size) {
res = AVERROR_INVALIDDATA;
goto bitmap_end;
}
memcpy(pkt->data, buf + colormapsize*colormapbpp, linesize * height);

res = pkt->size;


Loading…
Cancel
Save