You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-11-27 22:48:53 +02:00
Fix HEIF/HEIC header parsing bug
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
### Fix
|
### Fix
|
||||||
- Fix error when requested WebP dimension exceeds the WebP dimension limit.
|
- Fix error when requested WebP dimension exceeds the WebP dimension limit.
|
||||||
- Fix path parsing in some rare cases.
|
- Fix path parsing in some rare cases.
|
||||||
|
- Fix HEIC/HEIF header parsing bug.
|
||||||
|
|
||||||
## [2.13.1] - 2020-05-06
|
## [2.13.1] - 2020-05-06
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func (d *heicDimensionsData) IsFilled() bool {
|
|||||||
|
|
||||||
func heicReadBoxHeader(r io.Reader) (boxType string, boxDataSize int64, err error) {
|
func heicReadBoxHeader(r io.Reader) (boxType string, boxDataSize int64, err error) {
|
||||||
b := make([]byte, heicBoxHeaderSize)
|
b := make([]byte, heicBoxHeaderSize)
|
||||||
_, err = r.Read(b)
|
_, err = io.ReadFull(r, b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ func heicReadBoxHeader(r io.Reader) (boxType string, boxDataSize int64, err erro
|
|||||||
|
|
||||||
func heicReadBoxData(r io.Reader, boxDataSize int64) (b []byte, err error) {
|
func heicReadBoxData(r io.Reader, boxDataSize int64) (b []byte, err error) {
|
||||||
b = make([]byte, boxDataSize)
|
b = make([]byte, boxDataSize)
|
||||||
_, err = r.Read(b)
|
_, err = io.ReadFull(r, b)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ func heicReadMeta(d *heicDimensionsData, r io.Reader, boxDataSize int64) error {
|
|||||||
return errors.New("Invalid meta data")
|
return errors.New("Invalid meta data")
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := r.Read(make([]byte, 4)); err != nil {
|
if _, err := io.ReadFull(r, make([]byte, 4)); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user