comparison rtpenc_h263.c @ 5822:528440939c06 libavformat

Fix a crash in the H.263 RTP packetizer If size == 1 and buf[0] == 0 and buf[1] == 0 (the first byte after the buffer), it would set size = -1 and crash in the later memcpy.
author mstorsjo
date Thu, 11 Mar 2010 16:26:14 +0000
parents e09092917f7e
children
comparison
equal deleted inserted replaced
5821:9e77d08ad311 5822:528440939c06
48 48
49 max_packet_size = s->max_payload_size; 49 max_packet_size = s->max_payload_size;
50 50
51 while (size > 0) { 51 while (size > 0) {
52 q = s->buf; 52 q = s->buf;
53 if ((buf1[0] == 0) && (buf1[1] == 0)) { 53 if (size >= 2 && (buf1[0] == 0) && (buf1[1] == 0)) {
54 *q++ = 0x04; 54 *q++ = 0x04;
55 buf1 += 2; 55 buf1 += 2;
56 size -= 2; 56 size -= 2;
57 } else { 57 } else {
58 *q++ = 0; 58 *q++ = 0;