aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rv10.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-07 14:02:19 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-07 14:02:23 +0100
commit1c65393906abcf25f454834cf038c5a6ee1c3624 (patch)
tree63e4503439ca2fe35fc670e218febd3d9675a0d7 /libavcodec/rv10.c
parentb8d6108cfcb81cd231b96f59411237f9e244d1c2 (diff)
parent605b047bcc48482dc8a356f56629da259fbddbf1 (diff)
downloadffmpeg-1c65393906abcf25f454834cf038c5a6ee1c3624.tar.gz
Merge commit '605b047bcc48482dc8a356f56629da259fbddbf1'
* commit '605b047bcc48482dc8a356f56629da259fbddbf1': rv10: improve buffer size check. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r--libavcodec/rv10.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index 06b1606efb..8cd7d0370f 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -695,11 +695,15 @@ static int rv10_decode_frame(AVCodecContext *avctx,
if(!avctx->slice_count){
slice_count = (*buf++) + 1;
buf_size--;
+
+ if (!slice_count || buf_size <= 8 * slice_count) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid slice count: %d.\n", slice_count);
+ return AVERROR_INVALIDDATA;
+ }
+
slices_hdr = buf + 4;
buf += 8 * slice_count;
buf_size -= 8 * slice_count;
- if (buf_size <= 0)
- return AVERROR_INVALIDDATA;
}else
slice_count = avctx->slice_count;