diff --git a/libavcodec/decode.c b/libavcodec/decode.c index f395948d60..ae86e270df 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -2337,7 +2337,7 @@ static int attach_displaymatrix(AVCodecContext *avctx, AVFrame *frame, int orien int32_t *matrix; int ret; /* invalid orientation */ - if (orientation < 2 || orientation > 8) + if (orientation < 1 || orientation > 8) return AVERROR_INVALIDDATA; ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9, &sd); if (ret < 0) { diff --git a/tests/ref/fate/exif-image-jpg b/tests/ref/fate/exif-image-jpg index 25f3b228ff..84136a9f85 100644 --- a/tests/ref/fate/exif-image-jpg +++ b/tests/ref/fate/exif-image-jpg @@ -34,7 +34,6 @@ alpha_mode=unspecified TAG:ImageDescription= TAG:Make=Canon TAG:Model=Canon PowerShot SX200 IS -TAG:Orientation= 1 TAG:XResolution= 180:1 TAG:YResolution= 180:1 TAG:ResolutionUnit= 2 @@ -199,7 +198,16 @@ TAG:ExifIFD/WhiteBalance= 0 TAG:ExifIFD/DigitalZoomRatio= 4000:4000 TAG:ExifIFD/SceneCaptureType= 0 [SIDE_DATA] +side_data_type=3x3 displaymatrix +displaymatrix= +00000000: 65536 0 0 +00000001: 0 65536 0 +00000002: 0 0 1073741824 + +rotation=0 +[/SIDE_DATA] +[SIDE_DATA] side_data_type=EXIF metadata -size=3297 +size=3285 [/SIDE_DATA] [/FRAME] diff --git a/tests/ref/fate/exif-image-tiff b/tests/ref/fate/exif-image-tiff index f6314190b2..eebbd4f2e6 100644 --- a/tests/ref/fate/exif-image-tiff +++ b/tests/ref/fate/exif-image-tiff @@ -43,7 +43,6 @@ TAG:0x010A= 1 TAG:0x010D=image_small.tiff TAG:StripOffsets= 8, 7808, 15608, 23408, 31208, 39008, 46808, 54608 62408 -TAG:Orientation= 1 TAG:SamplesPerPixel= 3 TAG:RowsPerStrip= 13 TAG:StripByteCounts= 7800, 7800, 7800, 7800, 7800, 7800, 7800, 7800 @@ -54,7 +53,16 @@ TAG:PlanarConfiguration= 1 TAG:ResolutionUnit= 3 TAG:Software=ImageMagick 6.5.8-0 2010-02-09 Q16 http://www.imagemagick.org [SIDE_DATA] +side_data_type=3x3 displaymatrix +displaymatrix= +00000000: 65536 0 0 +00000001: 0 65536 0 +00000002: 0 0 1073741824 + +rotation=0 +[/SIDE_DATA] +[SIDE_DATA] side_data_type=EXIF metadata -size=403 +size=391 [/SIDE_DATA] [/FRAME] diff --git a/tests/ref/fate/exif-image-webp b/tests/ref/fate/exif-image-webp index 0f96254aa1..7b695bc923 100644 --- a/tests/ref/fate/exif-image-webp +++ b/tests/ref/fate/exif-image-webp @@ -34,7 +34,6 @@ alpha_mode=unspecified TAG:ImageDescription= TAG:Make=Canon TAG:Model=Canon PowerShot SX200 IS -TAG:Orientation= 1 TAG:XResolution= 180:1 TAG:YResolution= 180:1 TAG:ResolutionUnit= 2 @@ -199,7 +198,16 @@ TAG:ExifIFD/WhiteBalance= 0 TAG:ExifIFD/DigitalZoomRatio= 4000:4000 TAG:ExifIFD/SceneCaptureType= 0 [SIDE_DATA] +side_data_type=3x3 displaymatrix +displaymatrix= +00000000: 65536 0 0 +00000001: 0 65536 0 +00000002: 0 0 1073741824 + +rotation=0 +[/SIDE_DATA] +[SIDE_DATA] side_data_type=EXIF metadata -size=9718 +size=3285 [/SIDE_DATA] [/FRAME]