[FFmpeg-cvslog] avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"

Michael Niedermayer git at videolan.org
Mon Aug 11 18:58:45 CEST 2014


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Thu Aug  7 02:27:07 2014 +0200| [723512ac71716d1f27ed33f4742913cba3e47ae5] | committer: Michael Niedermayer

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 at gmx.at>
(cherry picked from commit 4213fc5b9eebec53c7d22b770c3f1ceecca1c113)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=723512ac71716d1f27ed33f4742913cba3e47ae5
---

 libavcodec/svq1dec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index cab9bac..eb64344 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -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;
 }



More information about the ffmpeg-cvslog mailing list