aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/exr.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-01-30 13:38:16 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-01-30 13:38:16 +0100
commit31f5fa21b03d16e285035a053d3267880ef9a12b (patch)
tree65d8c835f6e054a08a26770d07984ea00dacebd8 /libavcodec/exr.c
parentd391feff544f014a01393673f373bbdbca8c9af5 (diff)
downloadandroid_external_ffmpeg-31f5fa21b03d16e285035a053d3267880ef9a12b.tar.gz
android_external_ffmpeg-31f5fa21b03d16e285035a053d3267880ef9a12b.tar.bz2
android_external_ffmpeg-31f5fa21b03d16e285035a053d3267880ef9a12b.zip
lavc/exr: Move setting SAR down.
Fixes a theoretical issue if the resolution attribute is written behind the aspect attribute.
Diffstat (limited to 'libavcodec/exr.c')
-rw-r--r--libavcodec/exr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index c8c758e0a3..9ec99d65a0 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1030,7 +1030,7 @@ static int check_header_variable(EXRContext *s,
static int decode_header(EXRContext *s)
{
int current_channel_offset = 0;
- int magic_number, version, flags, i;
+ int magic_number, version, flags, i, sar = 0;
s->xmin = ~0;
s->xmax = ~0;
@@ -1227,8 +1227,7 @@ static int decode_header(EXRContext *s)
if (!var_size)
return AVERROR_INVALIDDATA;
- ff_set_sar(s->avctx,
- av_d2q(av_int2float(bytestream2_get_le32(&s->gb)), 255));
+ sar = bytestream2_get_le32(&s->gb);
continue;
} else if ((var_size = check_header_variable(s, "compression",
@@ -1259,6 +1258,8 @@ static int decode_header(EXRContext *s)
bytestream2_skip(&s->gb, bytestream2_get_le32(&s->gb));
}
+ ff_set_sar(s->avctx, av_d2q(av_int2float(sar), 255));
+
if (s->compression == EXR_UNKN) {
av_log(s->avctx, AV_LOG_ERROR, "Missing compression attribute.\n");
return AVERROR_INVALIDDATA;