aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-07-03 11:38:19 +0000
committerPaul B Mahol <onemda@gmail.com>2012-07-03 13:06:23 +0000
commitf8a81755c2e604febcbf88b5f17d601f30ae0bf9 (patch)
treec456411567197e60635918fd76ea747d2e5615a6
parent1bc9e4c5b27ee07a9e7e1f60e8ec355027f66f64 (diff)
downloadffmpeg-f8a81755c2e604febcbf88b5f17d601f30ae0bf9.tar.gz
jvdec: remove redundant check
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavcodec/jvdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
index 8acd50a45c..a8c3336ccc 100644
--- a/libavcodec/jvdec.c
+++ b/libavcodec/jvdec.c
@@ -142,7 +142,7 @@ static int decode_frame(AVCodecContext *avctx,
buf += 5;
if (video_size) {
- if (video_size < 0 || video_size > avpkt->size) {
+ if (video_size < 0 || video_size > avpkt->size - 5) {
av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size);
return AVERROR_INVALIDDATA;
}
@@ -153,7 +153,7 @@ static int decode_frame(AVCodecContext *avctx,
if (video_type == 0 || video_type == 1) {
GetBitContext gb;
- init_get_bits(&gb, buf, 8 * FFMIN(video_size, buf_end - buf));
+ init_get_bits(&gb, buf, 8 * video_size);
for (j = 0; j < avctx->height; j += 8)
for (i = 0; i < avctx->width; i += 8)