[FFmpeg-cvslog] avio: detect implicit truncation by assert in avio_w*

Michael Niedermayer git at videolan.org
Wed Oct 24 16:02:19 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 15 16:02:14 2012 +0200| [8a34b85fa8ded31d9f0572f902c2bcbf3a2e0b74] | committer: Michael Niedermayer

avio: detect implicit truncation by assert in avio_w*

This check is somewhat more lenient as would be ideal because we dont
know if the input is signed or unsigned

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

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

 libavformat/aviobuf.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 3748818..906415d 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -144,6 +144,7 @@ static void flush_buffer(AVIOContext *s)
 
 void avio_w8(AVIOContext *s, int b)
 {
+    av_assert2(b>=-128 && b<=255);
     *s->buf_ptr++ = b;
     if (s->buf_ptr >= s->buf_end)
         flush_buffer(s);



More information about the ffmpeg-cvslog mailing list