summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-16 16:23:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-16 16:59:28 +0100
commitf890cb948c932e3b01f9a616ff1600769c539853 (patch)
tree070df34c421deb7d5140f7b0327f2b26cef9040d
parentee181f84a31d5ba3efd28bd635f249cc5240f5a8 (diff)
mtvdemuxer: fix segfault caused by truncated packets.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mtv.c2
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;