mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
fix some warnings from static analysis
http://code.google.com/p/webp/issues/detail?id=138 Change-Id: I21470e965357cc14eab356e2c477c7846ff76ef2
This commit is contained in:
@ -425,6 +425,7 @@ static ParseStatus ParseSingleImage(WebPDemuxer* const dmux) {
|
||||
MemBuffer* const mem = &dmux->mem_;
|
||||
Frame* frame;
|
||||
ParseStatus status;
|
||||
int image_added = 0;
|
||||
|
||||
if (dmux->frames_ != NULL) return PARSE_ERROR;
|
||||
if (SizeIsInvalid(mem, min_size)) return PARSE_ERROR;
|
||||
@ -453,12 +454,15 @@ static ParseStatus ParseSingleImage(WebPDemuxer* const dmux) {
|
||||
dmux->canvas_height_ = frame->height_;
|
||||
dmux->feature_flags_ |= frame->has_alpha_ ? ALPHA_FLAG : 0;
|
||||
}
|
||||
AddFrame(dmux, frame);
|
||||
dmux->num_frames_ = 1;
|
||||
} else {
|
||||
free(frame);
|
||||
if (!AddFrame(dmux, frame)) {
|
||||
status = PARSE_ERROR; // last frame was left incomplete
|
||||
} else {
|
||||
image_added = 1;
|
||||
dmux->num_frames_ = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!image_added) free(frame);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user