[FFmpeg-cvslog] jvdec: remove redundant check
Paul B Mahol
git at videolan.org
Tue Jul 3 16:20:53 CEST 2012
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Jul 3 11:38:19 2012 +0000| [f8a81755c2e604febcbf88b5f17d601f30ae0bf9] | committer: Paul B Mahol
jvdec: remove redundant check
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8a81755c2e604febcbf88b5f17d601f30ae0bf9
---
libavcodec/jvdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
index 8acd50a..a8c3336 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)
More information about the ffmpeg-cvslog
mailing list