On Wed, Dec 07, 2011 at 01:06:25PM +0100, Diego Biurrun wrote:
> ---
> libavcodec/atrac3.c | 11 +++++++----
> libavcodec/mpegvideo.c | 7 ++++---
> libavcodec/mpegvideo_common.h | 2 +-
> libavcodec/msrledec.c | 4 ++--
> libavcodec/vc1dec.c | 2 +-
> libavcodec/vorbisdec.c | 2 +-
> libavdevice/libdc1394.c | 4 ++--
> 7 files changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
> index bdd0340..744ef17 100644
> --- a/libavcodec/atrac3.c
> +++ b/libavcodec/atrac3.c
> @@ -708,9 +708,10 @@ static int decodeChannelSoundUnit (ATRAC3Context *q,
> GetBitContext *gb, channel_
> memset(pSnd->IMDCT_buf, 0, 512 * sizeof(float));
>
> /* gain compensation and overlapping */
> - gainCompensateAndOverlap (pSnd->IMDCT_buf,
> &(pSnd->prevFrame[band*256]), &(pOut[band*256]),
> - &((pSnd->gainBlock[1 -
> (pSnd->gcBlkSwitch)]).gBlock[band]),
> -
> &((pSnd->gainBlock[pSnd->gcBlkSwitch]).gBlock[band]));
> + gainCompensateAndOverlap(pSnd->IMDCT_buf, &pSnd->prevFrame[band *
> 256],
> + &pOut[band * 256],
> + &pSnd->gainBlock[1 -
> pSnd->gcBlkSwitch].gBlock[band],
> + &pSnd->gainBlock[
> pSnd->gcBlkSwitch].gBlock[band]);
> }
>
> /* Swap the gain control buffers for the next frame. */
> @@ -795,7 +796,9 @@ static int decodeFrame(ATRAC3Context *q, const uint8_t*
> databuf,
> for (i=0 ; i<q->channels ; i++) {
>
> /* Set the bitstream reader at the start of a channel sound
> unit. */
> - init_get_bits(&q->gb,
> databuf+((i*q->bytes_per_frame)/q->channels),
> (q->bits_per_frame)/q->channels);
> + init_get_bits(&q->gb,
> + databuf + i * q->bytes_per_frame / q->channels,
> + q->bits_per_frame / q->channels);
>
> result = decodeChannelSoundUnit(q,&q->gb, &q->pUnits[i],
> out_samples[i], i, q->codingMode);
> if (result != 0)
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 78fae10..f2651c8 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -885,7 +885,7 @@ av_cold int MPV_common_init(MpegEncContext *s)
>
> s->parse_context.state = -1;
> if ((s->avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) ||
> - (s->avctx->debug_mv)) {
> + s->avctx->debug_mv) {
> s->visualization_buffer[0] = av_malloc((s->mb_width * 16 +
> 2 * EDGE_WIDTH) * s->mb_height * 16 + 2 *
> EDGE_WIDTH);
> s->visualization_buffer[1] = av_malloc((s->mb_width * 16 +
> @@ -1564,7 +1564,8 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame
> *pict){
> }
> }
>
> - if((s->avctx->debug&(FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) ||
> (s->avctx->debug_mv)){
> + if ((s->avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) ||
> + s->avctx->debug_mv) {
> const int shift= 1 + s->quarter_sample;
> int mb_y;
> uint8_t *ptr;
> @@ -1589,7 +1590,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame
> *pict){
> int mb_x;
> for(mb_x=0; mb_x<s->mb_width; mb_x++){
> const int mb_index= mb_x + mb_y*s->mb_stride;
> - if((s->avctx->debug_mv) && pict->motion_val){
> + if (s->avctx->debug_mv && pict->motion_val) {
> int type;
> for(type=0; type<3; type++){
> int direction = 0;
> diff --git a/libavcodec/mpegvideo_common.h b/libavcodec/mpegvideo_common.h
> index 96155d0..b5b0d23 100644
> --- a/libavcodec/mpegvideo_common.h
> +++ b/libavcodec/mpegvideo_common.h
> @@ -585,7 +585,7 @@ static inline void chroma_4mv_motion(MpegEncContext *s,
> if (src_y == (s->height >> 1))
> dxy &= ~2;
>
> - offset = (src_y * (s->uvlinesize)) + src_x;
> + offset = src_y * s->uvlinesize + src_x;
> ptr = ref_picture[1] + offset;
> if(s->flags&CODEC_FLAG_EMU_EDGE){
> if( (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8
> diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c
> index 46cd50d..5e33a59 100644
> --- a/libavcodec/msrledec.c
> +++ b/libavcodec/msrledec.c
> @@ -138,8 +138,8 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx,
> AVPicture *pic, int de
> uint32_t av_uninit(pix32);
> unsigned int width= FFABS(pic->linesize[0]) / (depth >> 3);
>
> - output = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
> - output_end = pic->data[0] + (avctx->height) * pic->linesize[0];
> + output = pic->data[0] + (avctx->height - 1) * pic->linesize[0];
> + output_end = pic->data[0] + avctx->height * pic->linesize[0];
> while(src < data + srcsize) {
> p1 = *src++;
> if(p1 == 0) { //Escape code
> diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
> index b5b8c29..7c9e906 100644
> --- a/libavcodec/vc1dec.c
> +++ b/libavcodec/vc1dec.c
> @@ -236,7 +236,7 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v)
> if (s->mb_x) {
> topleft_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1;
> fieldtx = v->fieldtx_plane[topleft_mb_pos];
> - stride_y = (s->linesize) << fieldtx;
> + stride_y = s->linesize << fieldtx;
> v_dist = (16 - fieldtx) >> (fieldtx == 0);
> s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],
> s->dest[0] - 16 * s->linesize -
> 16,
> diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
> index 381b61d..fca7fe8 100644
> --- a/libavcodec/vorbisdec.c
> +++ b/libavcodec/vorbisdec.c
> @@ -676,7 +676,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context
> *vc)
> /* Validations to prevent a buffer overflow later. */
> if (res_setup->begin>res_setup->end ||
> res_setup->end > vc->avccontext->channels * vc->blocksize[1] / 2
> ||
> - (res_setup->end-res_setup->begin) / res_setup->partition_size >
> V_MAX_PARTITIONS) {
> + res_setup->end-res_setup->begin / res_setup->partition_size >
> V_MAX_PARTITIONS) {
you haven't spotted subtraction operator here
the rest looks fine though (but don't forget to run FATE just in case)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel