Commit 5f90ad99 authored by Vittorio Giovara's avatar Vittorio Giovara

spherical: Change types of bounding and pad to uint32_t

These values are defined to be 32bit in the specification,
so it makes more sense to store them as fixed width.

Based on a patch by Micahel Niedermayer <michael@niedermayer.cc>.
Signed-off-by: 's avatarVittorio Giovara <vittorio.giovara@gmail.com>
parent 35cf146a
...@@ -339,7 +339,7 @@ static void dump_spherical(void *ctx, AVCodecParameters *par, AVPacketSideData * ...@@ -339,7 +339,7 @@ static void dump_spherical(void *ctx, AVCodecParameters *par, AVPacketSideData *
&l, &t, &r, &b); &l, &t, &r, &b);
av_log(ctx, AV_LOG_INFO, "[%zu, %zu, %zu, %zu] ", l, t, r, b); av_log(ctx, AV_LOG_INFO, "[%zu, %zu, %zu, %zu] ", l, t, r, b);
} else if (spherical->projection == AV_SPHERICAL_CUBEMAP) { } else if (spherical->projection == AV_SPHERICAL_CUBEMAP) {
av_log(ctx, AV_LOG_INFO, "[pad %zu] ", spherical->padding); av_log(ctx, AV_LOG_INFO, "[pad %"PRIu32"] ", spherical->padding);
} }
} }
......
...@@ -1601,8 +1601,8 @@ static int mkv_parse_video_projection(AVStream *st, const MatroskaTrack *track) ...@@ -1601,8 +1601,8 @@ static int mkv_parse_video_projection(AVStream *st, const MatroskaTrack *track)
AVSphericalMapping *spherical; AVSphericalMapping *spherical;
enum AVSphericalProjection projection; enum AVSphericalProjection projection;
size_t spherical_size; size_t spherical_size;
size_t l = 0, t = 0, r = 0, b = 0; uint32_t l = 0, t = 0, r = 0, b = 0;
size_t padding = 0; uint32_t padding = 0;
int ret; int ret;
GetByteContext gb; GetByteContext gb;
...@@ -1627,7 +1627,7 @@ static int mkv_parse_video_projection(AVStream *st, const MatroskaTrack *track) ...@@ -1627,7 +1627,7 @@ static int mkv_parse_video_projection(AVStream *st, const MatroskaTrack *track)
if (b >= UINT_MAX - t || r >= UINT_MAX - l) { if (b >= UINT_MAX - t || r >= UINT_MAX - l) {
av_log(NULL, AV_LOG_ERROR, av_log(NULL, AV_LOG_ERROR,
"Invalid bounding rectangle coordinates " "Invalid bounding rectangle coordinates "
"%zu,%zu,%zu,%zu\n", l, t, r, b); "%"PRIu32",%"PRIu32",%"PRIu32",%"PRIu32"\n", l, t, r, b);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
} else if (track->video.projection.private.size != 0) { } else if (track->video.projection.private.size != 0) {
......
...@@ -3237,9 +3237,8 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -3237,9 +3237,8 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
MOVStreamContext *sc; MOVStreamContext *sc;
int size, version, layout; int size, version, layout;
int32_t yaw, pitch, roll; int32_t yaw, pitch, roll;
size_t l = 0, t = 0, r = 0, b = 0; uint32_t l = 0, t = 0, r = 0, b = 0;
size_t padding = 0; uint32_t tag, padding = 0;
uint32_t tag;
enum AVSphericalProjection projection; enum AVSphericalProjection projection;
if (c->fc->nb_streams < 1) if (c->fc->nb_streams < 1)
...@@ -3335,7 +3334,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -3335,7 +3334,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (b >= UINT_MAX - t || r >= UINT_MAX - l) { if (b >= UINT_MAX - t || r >= UINT_MAX - l) {
av_log(c->fc, AV_LOG_ERROR, av_log(c->fc, AV_LOG_ERROR,
"Invalid bounding rectangle coordinates " "Invalid bounding rectangle coordinates "
"%zu,%zu,%zu,%zu\n", l, t, r, b); "%"PRIu32",%"PRIu32",%"PRIu32",%"PRIu32"\n", l, t, r, b);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
......
...@@ -164,10 +164,10 @@ typedef struct AVSphericalMapping { ...@@ -164,10 +164,10 @@ typedef struct AVSphericalMapping {
* projection type (@ref AV_SPHERICAL_EQUIRECTANGULAR_TILE), * projection type (@ref AV_SPHERICAL_EQUIRECTANGULAR_TILE),
* and should be ignored in all other cases. * and should be ignored in all other cases.
*/ */
size_t bound_left; ///< Distance from the left edge uint32_t bound_left; ///< Distance from the left edge
size_t bound_top; ///< Distance from the top edge uint32_t bound_top; ///< Distance from the top edge
size_t bound_right; ///< Distance from the right edge uint32_t bound_right; ///< Distance from the right edge
size_t bound_bottom; ///< Distance from the bottom edge uint32_t bound_bottom; ///< Distance from the bottom edge
/** /**
* @} * @}
*/ */
...@@ -179,7 +179,7 @@ typedef struct AVSphericalMapping { ...@@ -179,7 +179,7 @@ typedef struct AVSphericalMapping {
* (@ref AV_SPHERICAL_CUBEMAP), and should be ignored in all other * (@ref AV_SPHERICAL_CUBEMAP), and should be ignored in all other
* cases. * cases.
*/ */
size_t padding; uint32_t padding;
} AVSphericalMapping; } AVSphericalMapping;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment