diff options
author | Mike Melanson <mike@multimedia.cx> | 2008-03-05 06:58:20 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2008-03-05 06:58:20 +0000 |
commit | 282ee4e766b1133fc3b04be5ad4c1b8671c51642 (patch) | |
tree | c15217128f184eaed821cb996e32532c4dd3a899 /libavcodec/xan.c | |
parent | 56adc69501ec2a9a42b741bace3cb484ca413d81 (diff) | |
download | ffmpeg-282ee4e766b1133fc3b04be5ad4c1b8671c51642.tar.gz |
fix the WC3 Xan decoder by correcting the frame accounting logic
Originally committed as revision 12326 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/xan.c')
-rw-r--r-- | libavcodec/xan.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 27fc16488a..8dad6e83f9 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -435,12 +435,12 @@ static int xan_decode_frame(AVCodecContext *avctx, if (s->last_frame.data[0]) avctx->release_buffer(avctx, &s->last_frame); - /* shuffle frames */ - s->last_frame = s->current_frame; - *data_size = sizeof(AVFrame); *(AVFrame*)data = s->current_frame; + /* shuffle frames */ + FFSWAP(AVFrame, s->current_frame, s->last_frame); + /* always report that the buffer was completely consumed */ return buf_size; } @@ -449,9 +449,11 @@ static int xan_decode_end(AVCodecContext *avctx) { XanContext *s = avctx->priv_data; - /* release the last frame */ + /* release the frames */ if (s->last_frame.data[0]) avctx->release_buffer(avctx, &s->last_frame); + if (s->current_frame.data[0]) + avctx->release_buffer(avctx, &s->current_frame); av_free(s->buffer1); av_free(s->buffer2); |