diff --git a/libavcodec/svq1.c b/libavcodec/svq1.c
index 9881ab5f09ea38ebbca4e4a6f7a86e5a3244b32b..bba2352dfc4801abfe0ef3ba957020af8c56894f 100644
--- a/libavcodec/svq1.c
+++ b/libavcodec/svq1.c
@@ -579,7 +579,7 @@ static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
 
   seed = string_table[out[0]];
 
-  for (i=1; i < out[0]; i++) {
+  for (i=1; i <= out[0]; i++) {
     out[i] = get_bits (bitbuf, 8) ^ seed;
     seed   = string_table[out[i] ^ seed];
   }