summaryrefslogtreecommitdiff
path: root/libavcodec/loco.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-24 13:03:13 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-24 13:08:52 +0100
commit33796645dc35511ff7419b96535ad05dd73ffde8 (patch)
treef0549c8b4b17121f1c86d253f45277be1a6f2d27 /libavcodec/loco.c
parent714ff44858a07578e592dfabd9e1f0a5edbf80bf (diff)
loco: check the last plane too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/loco.c')
-rw-r--r--libavcodec/loco.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index 559f7c2026..e21e693166 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -240,10 +240,14 @@ static int decode_frame(AVCodecContext *avctx,
break;
}
+ if (decoded < 0 || decoded > buf_size)
+ goto buf_too_small;
+ buf_size -= decoded;
+
*got_frame = 1;
*(AVFrame*)data = l->pic;
- return buf_size < 0 ? -1 : avpkt->size - buf_size;
+ return avpkt->size - buf_size;
buf_too_small:
av_log(avctx, AV_LOG_ERROR, "Input data too small.\n");
return AVERROR(EINVAL);