[FFmpeg-cvslog] vmdav: use more unchecked bytestream2 variants where it makes sense

Paul B Mahol git at videolan.org
Fri Mar 29 20:51:15 CET 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Mar 29 19:48:45 2013 +0000| [a345b7f906de89637544d98302819e19bb5b2a5f] | committer: Paul B Mahol

vmdav: use more unchecked bytestream2 variants where it makes sense

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/vmdav.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index f4364ce..867d8c76 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -98,7 +98,7 @@ static void lz_unpack(const unsigned char *src, int src_len,
     if (bytestream2_get_bytes_left(&gb) < 4)
         return;
     if (bytestream2_peek_le32(&gb) == 0x56781234) {
-        bytestream2_get_le32(&gb);
+        bytestream2_skipu(&gb, 4);
         qpos = 0x111;
         speclen = 0xF + 3;
     } else {
@@ -123,7 +123,7 @@ static void lz_unpack(const unsigned char *src, int src_len,
                 if (tag & 0x01) {
                     if (d_end - d < 1 || bytestream2_get_bytes_left(&gb) < 1)
                         return;
-                    queue[qpos++] = *d++ = bytestream2_get_byte(&gb);
+                    queue[qpos++] = *d++ = bytestream2_get_byteu(&gb);
                     qpos &= QUEUE_MASK;
                     dataleft--;
                 } else {
@@ -173,7 +173,7 @@ static int rle_unpack(const unsigned char *src, unsigned char *dest,
             l = (l & 0x7F) * 2;
             if (dest_end - pd < l || bytestream2_get_bytes_left(&gb) < l)
                 return bytestream2_tell(&gb);
-            bytestream2_get_buffer(&gb, pd, l);
+            bytestream2_get_bufferu(&gb, pd, l);
             pd += l;
         } else {
             if (dest_end - pd < i || bytestream2_get_bytes_left(&gb) < 2)
@@ -281,7 +281,7 @@ static void vmd_decode(VmdVideoContext *s, AVFrame *frame)
                         len = (len & 0x7F) + 1;
                         if (ofs + len > frame_width || bytestream2_get_bytes_left(&gb) < len)
                             return;
-                        bytestream2_get_buffer(&gb, &dp[ofs], len);
+                        bytestream2_get_bufferu(&gb, &dp[ofs], len);
                         ofs += len;
                     } else {
                         /* interframe pixel copy */



More information about the ffmpeg-cvslog mailing list