Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Thomas Volkert authored on 2014/09/22 00:43:16... | ... |
@@ -150,9 +150,12 @@ void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf, int size, |
150 | 150 |
} |
151 | 151 |
if (mb_info_pos < mb_info_count) { |
152 | 152 |
const uint8_t *ptr = &mb_info[12*mb_info_pos]; |
153 |
+ /* get position in bits in the input packet at which the next info block should be used */ |
|
153 | 154 |
uint32_t bit_pos = AV_RL32(ptr); |
154 |
- uint32_t pos = (bit_pos + 7)/8; |
|
155 |
- if (pos <= end - buf_base) { |
|
155 |
+ /* get position in bytes */ |
|
156 |
+ uint32_t pos_next_mb_info = (bit_pos + 7)/8; |
|
157 |
+ /* check if data from the next MB info block should be used */ |
|
158 |
+ if (pos_next_mb_info <= end - buf_base) { |
|
156 | 159 |
state.quant = ptr[4]; |
157 | 160 |
state.gobn = ptr[5]; |
158 | 161 |
state.mba = AV_RL16(&ptr[6]); |
... | ... |
@@ -160,13 +163,9 @@ void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf, int size, |
160 | 160 |
state.vmv1 = (int8_t) ptr[9]; |
161 | 161 |
state.hmv2 = (int8_t) ptr[10]; |
162 | 162 |
state.vmv2 = (int8_t) ptr[11]; |
163 |
- ebits = 8 * pos - bit_pos; |
|
164 |
- len = pos - (buf - buf_base); |
|
163 |
+ ebits = 8 * pos_next_mb_info - bit_pos; |
|
164 |
+ len = pos_next_mb_info - (buf - buf_base); |
|
165 | 165 |
mb_info_pos++; |
166 |
- } else { |
|
167 |
- av_log(s1, AV_LOG_ERROR, |
|
168 |
- "Unable to split H263 packet, use -mb_info %d " |
|
169 |
- "or lower.\n", s->max_payload_size - 8); |
|
170 | 166 |
} |
171 | 167 |
} else { |
172 | 168 |
av_log(s1, AV_LOG_ERROR, "Unable to split H263 packet, " |