diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-16 16:23:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-16 16:59:28 +0100 |
commit | f890cb948c932e3b01f9a616ff1600769c539853 (patch) | |
tree | 070df34c421deb7d5140f7b0327f2b26cef9040d /libavformat/mtv.c | |
parent | ee181f84a31d5ba3efd28bd635f249cc5240f5a8 (diff) | |
download | ffmpeg-f890cb948c932e3b01f9a616ff1600769c539853.tar.gz |
mtvdemuxer: fix segfault caused by truncated packets.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mtv.c')
-rw-r--r-- | libavformat/mtv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mtv.c b/libavformat/mtv.c index b31e4cb88f..4252309a6e 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -196,7 +196,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) * just swap bytes as they come */ - for(i=0;i<mtv->img_segment_size/2;i++) + for(i=0;i<ret/2;i++) *((uint16_t *)pkt->data+i) = av_bswap16(*((uint16_t *)pkt->data+i)); #endif pkt->stream_index = 0; |