Skip to content

Commit

Permalink
fix: handle unfinished jpeg.
Browse files Browse the repository at this point in the history
  • Loading branch information
niwatly committed Aug 14, 2020
1 parent e88388a commit 382a31f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/formats/jpeg/jpeg_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class JpegData {
final sectionByteSize = input.readUint16();
if (sectionByteSize < 2) {
// jpeg section consists of more than 2 bytes at least
return false;
// return success only when SOF and SOS have already found (as a jpeg without EOF.)
break;
}
switch (marker) {
case Jpeg.M_SOF0: // SOF0 (Start of Frame, Baseline DCT)
Expand Down

0 comments on commit 382a31f

Please sign in to comment.