summaryrefslogtreecommitdiffstats
path: root/media/libwebp/demux/demux.c
diff options
context:
space:
mode:
authorJustOff <Off.Just.Off@gmail.com>2018-06-29 20:57:44 +0300
committerJustOff <Off.Just.Off@gmail.com>2018-06-29 20:57:44 +0300
commit47e9f9d4c1674cb3ee3bf29c415141520225243d (patch)
tree8b51f96dd85bb3253c0c61fa2b214465d53a95ed /media/libwebp/demux/demux.c
parent445ebe5a302895418ba993943de136449c743403 (diff)
downloadUXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.gz
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.lz
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.tar.xz
UXP-47e9f9d4c1674cb3ee3bf29c415141520225243d.zip
Sync libwebp sources with https://chromium.googlesource.com/webm/libwebp/+/v1.0.0
Diffstat (limited to 'media/libwebp/demux/demux.c')
-rw-r--r--media/libwebp/demux/demux.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/media/libwebp/demux/demux.c b/media/libwebp/demux/demux.c
index 100eab8c0..aec2a0a2d 100644
--- a/media/libwebp/demux/demux.c
+++ b/media/libwebp/demux/demux.c
@@ -23,9 +23,9 @@
#include "../webp/demux.h"
#include "../webp/format_constants.h"
-#define DMUX_MAJ_VERSION 0
-#define DMUX_MIN_VERSION 3
-#define DMUX_REV_VERSION 2
+#define DMUX_MAJ_VERSION 1
+#define DMUX_MIN_VERSION 0
+#define DMUX_REV_VERSION 0
typedef struct {
size_t start_; // start location of the data
@@ -205,12 +205,14 @@ static void SetFrameInfo(size_t start_offset, size_t size,
frame->complete_ = complete;
}
-// Store image bearing chunks to 'frame'.
+// Store image bearing chunks to 'frame'. 'min_size' is an optional size
+// requirement, it may be zero.
static ParseStatus StoreFrame(int frame_num, uint32_t min_size,
MemBuffer* const mem, Frame* const frame) {
int alpha_chunks = 0;
int image_chunks = 0;
- int done = (MemDataSize(mem) < min_size);
+ int done = (MemDataSize(mem) < CHUNK_HEADER_SIZE ||
+ MemDataSize(mem) < min_size);
ParseStatus status = PARSE_OK;
if (done) return PARSE_NEED_MORE_DATA;
@@ -401,9 +403,9 @@ static ParseStatus ParseSingleImage(WebPDemuxer* const dmux) {
frame = (Frame*)WebPSafeCalloc(1ULL, sizeof(*frame));
if (frame == NULL) return PARSE_ERROR;
- // For the single image case we allow parsing of a partial frame, but we need
- // at least CHUNK_HEADER_SIZE for parsing.
- status = StoreFrame(1, CHUNK_HEADER_SIZE, &dmux->mem_, frame);
+ // For the single image case we allow parsing of a partial frame, so no
+ // minimum size is imposed here.
+ status = StoreFrame(1, 0, &dmux->mem_, frame);
if (status != PARSE_ERROR) {
const int has_alpha = !!(dmux->feature_flags_ & ALPHA_FLAG);
// Clear any alpha when the alpha flag is missing.