Commit f890cb94 authored by Michael Niedermayer's avatar Michael Niedermayer

mtvdemuxer: fix segfault caused by truncated packets.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ee181f84
...@@ -196,7 +196,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -196,7 +196,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
* just swap bytes as they come * 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)); *((uint16_t *)pkt->data+i) = av_bswap16(*((uint16_t *)pkt->data+i));
#endif #endif
pkt->stream_index = 0; pkt->stream_index = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment