lib/lowleveljpeg: add Abs method, nil checks

This commit is contained in:
Nigel Tao committed 2025-02-23 12:24:43 +11:00
1 parent 12b404f58d
commit f483ef0849
4 files changed
+42 -2

No files matched your search

+4 -1
View File
@@ -16,7 +16,10 @@ package lowleveljpeg
//
// It uses a triangle filter.
func (dst *QuadBlockU8) UpsampleFrom(src *BlockU8) {
if (dst == nil) || (src == nil) {
if dst == nil {
return
} else if src == nil {
dst.SetToNeutral()
return
}
dst[0x00] = src[0x00]