[FFmpeg-cvslog] nellymoserenc: zero any leftover packet bytes

Justin Ruggles git at videolan.org
Mon Mar 5 00:28:55 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Mon Feb 27 23:39:50 2012 -0500| [29e2c8531096a5fb67079551564b4ab3f9acd8a6] | committer: Justin Ruggles

nellymoserenc: zero any leftover packet bytes

fixes writing of uninitialized packet data

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

 libavcodec/nellymoserenc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c
index 5848191..c0b1746 100644
--- a/libavcodec/nellymoserenc.c
+++ b/libavcodec/nellymoserenc.c
@@ -363,6 +363,7 @@ static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int
     }
 
     flush_put_bits(&pb);
+    memset(put_bits_ptr(&pb), 0, output + output_size - put_bits_ptr(&pb));
 }
 
 static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, void *data)



More information about the ffmpeg-cvslog mailing list