diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2016-09-29 08:33:14 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2016-09-29 08:33:14 +0200 |
commit | 508435541810172d1e6d3d684e1e081096233d97 (patch) | |
tree | 2b4f2b3f4044d05a226ab9ecc6a225e6970c0580 /src/ufodecode.c | |
parent | 9ec15f5120dfdf762c759d9d54d4586c6f88905d (diff) | |
download | libufodecode-508435541810172d1e6d3d684e1e081096233d97.tar.gz libufodecode-508435541810172d1e6d3d684e1e081096233d97.tar.bz2 libufodecode-508435541810172d1e6d3d684e1e081096233d97.tar.xz libufodecode-508435541810172d1e6d3d684e1e081096233d97.zip |
Do not attempt decoding if no more data left
Diffstat (limited to 'src/ufodecode.c')
-rw-r--r-- | src/ufodecode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ufodecode.c b/src/ufodecode.c index 6a90a54..a00ac9f 100644 --- a/src/ufodecode.c +++ b/src/ufodecode.c @@ -548,6 +548,11 @@ ufo_decoder_get_next_frame (UfoDecoder *decoder, uint16_t **pixels, UfoDecoderMe ((raw[pos] & 0xFFFFFFF0) != 0x51111110)) /* we can only match the first part */ pos++; + /* before even attempting to decode the non-existent frame, bail out */ + if (pos == num_words) { + return EIO; + } + advance = ufo_decoder_decode_frame (decoder, raw + pos, decoder->num_bytes - pos, *pixels, meta); /* |