avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"

Add padding, clear size, use the correct pointer.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-07 02:27:07 +02:00
parent e55e09949e
commit 4213fc5b9e
1 changed files with 2 additions and 1 deletions

View File

@ -635,7 +635,7 @@ static int svq1_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
av_fast_malloc(s->pkt_swapped, &s->pkt_swapped_allocated,
av_fast_padded_malloc(&s->pkt_swapped, &s->pkt_swapped_allocated,
buf_size);
if (!s->pkt_swapped)
return AVERROR(ENOMEM);
@ -818,6 +818,7 @@ static av_cold int svq1_decode_end(AVCodecContext *avctx)
av_frame_free(&s->prev);
av_freep(&s->pkt_swapped);
s->pkt_swapped_allocated = 0;
return 0;
}