X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Frtpenc_h263_rfc2190.c;h=34b39065b80b3b13af1521a3947498ed4650f72e;hp=04930086a045b537947064287a910349c546dcd5;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavformat/rtpenc_h263_rfc2190.c b/ffmpeg/libavformat/rtpenc_h263_rfc2190.c index 0493008..34b3906 100644 --- a/ffmpeg/libavformat/rtpenc_h263_rfc2190.c +++ b/ffmpeg/libavformat/rtpenc_h263_rfc2190.c @@ -150,9 +150,12 @@ void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf, int size, } if (mb_info_pos < mb_info_count) { const uint8_t *ptr = &mb_info[12*mb_info_pos]; + /* get position in bits in the input packet at which the next info block should be used */ uint32_t bit_pos = AV_RL32(ptr); - uint32_t pos = (bit_pos + 7)/8; - if (pos <= end - buf_base) { + /* get position in bytes */ + uint32_t pos_next_mb_info = (bit_pos + 7)/8; + /* check if data from the next MB info block should be used */ + if (pos_next_mb_info <= end - buf_base) { state.quant = ptr[4]; state.gobn = ptr[5]; state.mba = AV_RL16(&ptr[6]); @@ -160,13 +163,9 @@ void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf, int size, state.vmv1 = (int8_t) ptr[9]; state.hmv2 = (int8_t) ptr[10]; state.vmv2 = (int8_t) ptr[11]; - ebits = 8 * pos - bit_pos; - len = pos - (buf - buf_base); + ebits = 8 * pos_next_mb_info - bit_pos; + len = pos_next_mb_info - (buf - buf_base); mb_info_pos++; - } else { - av_log(s1, AV_LOG_ERROR, - "Unable to split H263 packet, use -mb_info %d " - "or lower.\n", s->max_payload_size - 8); } } else { av_log(s1, AV_LOG_ERROR, "Unable to split H263 packet, "