Hi, On Wed, Mar 7, 2012 at 10:21 AM, Kostya Shishkov <kostya.shish...@gmail.com> wrote: > On Tue, Mar 06, 2012 at 03:58:45PM -0800, Ronald S. Bultje wrote: >> From: "Ronald S. Bultje" <rsbul...@gmail.com> >> >> Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind >> CC: libav-sta...@libav.org >> --- >> libavcodec/roqvideo.h | 4 +-- >> libavcodec/roqvideodec.c | 69 >> +++++++++++++++++++++++----------------------- >> 2 files changed, 37 insertions(+), 36 deletions(-) >> >> diff --git a/libavcodec/roqvideo.h b/libavcodec/roqvideo.h >> index e2dc272..fba3d41 100644 >> --- a/libavcodec/roqvideo.h >> +++ b/libavcodec/roqvideo.h >> @@ -24,6 +24,7 @@ >> >> #include "libavutil/lfg.h" >> #include "avcodec.h" >> +#include "bytestream.h" >> #include "dsputil.h" >> >> typedef struct { >> @@ -53,8 +54,7 @@ typedef struct RoqContext { >> roq_cell cb2x2[256]; >> roq_qcell cb4x4[256]; >> >> - const unsigned char *buf; >> - int size; >> + GetByteContext gb; >> int width, height; >> >> /* Encoder only data */ >> diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c >> index 527ba51..0bf00cf 100644 >> --- a/libavcodec/roqvideodec.c >> +++ b/libavcodec/roqvideodec.c >> @@ -38,16 +38,15 @@ static void roqvideo_decode_frame(RoqContext *ri) >> unsigned int chunk_id = 0, chunk_arg = 0; >> unsigned long chunk_size = 0; >> int i, j, k, nv1, nv2, vqflg = 0, vqflg_pos = -1; >> - int vqid, bpos, xpos, ypos, xp, yp, x, y, mx, my; >> + int vqid, xpos, ypos, xp, yp, x, y, mx, my; >> int frame_stats[2][4] = {{0},{0}}; >> roq_qcell *qcell; >> - const unsigned char *buf = ri->buf; >> - const unsigned char *buf_end = ri->buf + ri->size; >> + int64_t chunk_start; >> >> - while (buf < buf_end) { >> - chunk_id = bytestream_get_le16(&buf); >> - chunk_size = bytestream_get_le32(&buf); >> - chunk_arg = bytestream_get_le16(&buf); >> + while (bytestream2_get_bytes_left(&ri->gb) > 0) { >> + chunk_id = bytestream2_get_le16(&ri->gb); >> + chunk_size = bytestream2_get_le32(&ri->gb); >> + chunk_arg = bytestream2_get_le16(&ri->gb); > > diego-nit
Nits fixed in separate patch for cosmetics only, OK now? Ronald _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel