changeset 779:915524c08334 libavcodec

3rd 10l - don't let it read data beyond the end of frame
author arpi_esp
date Sun, 27 Oct 2002 19:20:02 +0000
parents 6f24d6388750
children a48bb8bc63dd
files mjpeg.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mjpeg.c	Sun Oct 27 19:11:06 2002 +0000
+++ b/mjpeg.c	Sun Oct 27 19:20:02 2002 +0000
@@ -1283,7 +1283,7 @@
 
 		    while (src<buf_end)
 		    {
-			unsigned char x = *(src++);
+			UINT8 x = *(src++);
 			
 			*(dst++) = x;
 			if (x == 0xff)
@@ -1295,7 +1295,7 @@
 				break;
 			}
 		    }
-		    init_get_bits(&s->gb, s->buffer, s->buffer_size);
+		    init_get_bits(&s->gb, s->buffer, dst - s->buffer);
 		}
 		else
 		    init_get_bits(&s->gb, buf_ptr, buf_end - buf_ptr);