mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
fix two minor memory leaks in webpmux
(only occur in case of error) Change-Id: Icab69bb364b77f8eae6cae91047354c27e610602
This commit is contained in:
parent
47b9862f30
commit
3e59a74d72
@ -231,11 +231,13 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) {
|
||||
for (i = 1; i <= nFrames; i++) {
|
||||
WebPMuxFrameInfo frame;
|
||||
err = WebPMuxGetFrame(mux, i, &frame);
|
||||
RETURN_IF_ERROR3("Failed to retrieve %s#%d\n", type_str, i);
|
||||
printf("%3d: %8d %8d ", i, frame.x_offset, frame.y_offset);
|
||||
if (is_anim) printf("%8d %7d ", frame.duration, frame.dispose_method);
|
||||
printf("%10d\n", (int)frame.bitstream.size);
|
||||
if (err == WEBP_MUX_OK) {
|
||||
printf("%3d: %8d %8d ", i, frame.x_offset, frame.y_offset);
|
||||
if (is_anim) printf("%8d %7d ", frame.duration, frame.dispose_method);
|
||||
printf("%10d\n", (int)frame.bitstream.size);
|
||||
}
|
||||
WebPDataClear(&frame.bitstream);
|
||||
RETURN_IF_ERROR3("Failed to retrieve %s#%d\n", type_str, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -264,8 +266,11 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) {
|
||||
if ((flag & ALPHA_FLAG) && !(flag & (ANIMATION_FLAG | FRAGMENTS_FLAG))) {
|
||||
WebPMuxFrameInfo image;
|
||||
err = WebPMuxGetFrame(mux, 1, &image);
|
||||
if (err == WEBP_MUX_OK) {
|
||||
printf("Size of the image (with alpha): %d\n", (int)image.bitstream.size);
|
||||
}
|
||||
WebPDataClear(&image.bitstream);
|
||||
RETURN_IF_ERROR("Failed to retrieve the image\n");
|
||||
printf("Size of the image (with alpha): %d\n", (int)image.bitstream.size);
|
||||
}
|
||||
|
||||
return WEBP_MUX_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user