Skip to content

Commit

Permalink
[bugfix] allow store smaller PNG image than 261 bytes (superseriousbu…
Browse files Browse the repository at this point in the history
  • Loading branch information
KEINOS committed Oct 25, 2023
1 parent ced7006 commit 3df6e81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/media/processingmedia.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func (p *ProcessingMedia) store(ctx context.Context) error {
// and https://github.com/h2non/filetype
hdrBuf := make([]byte, 261)

// Read the first 261 header bytes into buffer.
if _, err := io.ReadFull(rc, hdrBuf); err != nil {
// Read the first 261 header bytes into buffer as much as possible.
if _, err := rc.Read(hdrBuf); err != nil {
return gtserror.Newf("error reading incoming media: %w", err)
}

Expand Down

0 comments on commit 3df6e81

Please sign in to comment.