summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/mjpeg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index f0634a0413..0f2a4e7196 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -1297,14 +1297,17 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
LAST_SKIP_BITS(re, &s->gb, code)
- if (i >= 64) {
+ if (i >= 63) {
+ if(i == 63){
+ j = s->scantable.permutated[63];
+ block[j] = level * quant_matrix[j];
+ break;
+ }
dprintf("error count: %d\n", i);
return -1;
}
j = s->scantable.permutated[i];
block[j] = level * quant_matrix[j];
- if (i >= 63)
- break;
}
}
CLOSE_READER(re, &s->gb)