summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/native
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/native')
-rw-r--r--libmpcodecs/native/qtrle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmpcodecs/native/qtrle.c b/libmpcodecs/native/qtrle.c
index 6d46f9b32c..89cf99c10c 100644
--- a/libmpcodecs/native/qtrle.c
+++ b/libmpcodecs/native/qtrle.c
@@ -61,7 +61,8 @@ void qt_decode_rle24(
{
pixel_ptr = row_ptr + ((encoded[stream_ptr++] - 1) * bytes_per_pixel);
- while ((rle_code = (signed char)encoded[stream_ptr++]) != -1)
+ while (stream_ptr < encoded_size &&
+ (rle_code = (signed char)encoded[stream_ptr++]) != -1)
{
if (rle_code == 0)
// there's another skip code in the stream