Skip to content

Commit

Permalink
Add -fanalyzer to make debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jan 15, 2022
1 parent c39ba51 commit 2860ce3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CFLAGS = -Ofast -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-except

DEBUGFLAGS = -Wall -Wextra -pedantic -Wcast-align -Wduplicated-branches -Wduplicated-cond -Wlogical-op \
-Wnull-dereference -Wshadow -Wshift-overflow=2 -Wundef -Wunused -Wwrite-strings -Wno-sign-compare \
-Wno-implicit-fallthrough -Wno-parentheses -Wno-dangling-else
-Wno-implicit-fallthrough -Wno-parentheses -Wno-dangling-else -fanalyzer -fanalyzer-verbosity=0

.PHONY: all clean basefiles debug

Expand Down
21 changes: 11 additions & 10 deletions src/jpeghierarchical.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ unsigned load_hierarchical_JPEG (struct context * context, const struct JPEG_mar
double * data = output[frameIDs[p]];
for (index = 0; index < limit; index ++) data[index] = (uint16_t) ((long) (data[index] + 65536.5)); // avoid UB and round negative values correctly
}
double * buffer = NULL;
if (expand) buffer = ctxmalloc(context, sizeof *buffer * framewidth * frameheight);
if (expand & 0x10) for (p = 0; p < framecount; p ++) {
expand_JPEG_component_horizontally(context, output[frameIDs[p]], component_size[frameIDs[p]], component_size[frameIDs[p] + 4], framewidth, buffer);
component_size[frameIDs[p]] = framewidth;
}
if (expand & 1) for (p = 0; p < framecount; p ++) {
expand_JPEG_component_vertically(context, output[frameIDs[p]], component_size[frameIDs[p]], component_size[frameIDs[p] + 4], frameheight, buffer);
component_size[frameIDs[p] + 4] = frameheight;
if (expand) {
double * buffer = ctxmalloc(context, sizeof *buffer * framewidth * frameheight);
if (expand & 0x10) for (p = 0; p < framecount; p ++) {
expand_JPEG_component_horizontally(context, output[frameIDs[p]], component_size[frameIDs[p]], component_size[frameIDs[p] + 4], framewidth, buffer);
component_size[frameIDs[p]] = framewidth;
}
if (expand & 1) for (p = 0; p < framecount; p ++) {
expand_JPEG_component_vertically(context, output[frameIDs[p]], component_size[frameIDs[p]], component_size[frameIDs[p] + 4], frameheight, buffer);
component_size[frameIDs[p] + 4] = frameheight;
}
ctxfree(context, buffer);
}
ctxfree(context, buffer);
for (p = 0; p < framecount; p ++) if ((component_size[frameIDs[p]] != framewidth) || (component_size[frameIDs[p] + 4] != frameheight))
throw(context, PLUM_ERR_INVALID_FILE_FORMAT);
} else {
Expand Down

0 comments on commit 2860ce3

Please sign in to comment.