Re: [FFmpeg-devel] [PATCH] mov: Fix checking layout and loading padding for cubemaps

2017-03-07 Thread James Almer
On 3/7/2017 7:31 PM, Vittorio Giovara wrote:
> ---
> I missed this chunk of review in this version of the set,
> sorry, here is the proper patch.
> Vittorio
> 
>  libavformat/mov.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index cc098cd977..d5c3949050 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4635,7 +4635,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  {
>  AVStream *st;
>  MOVStreamContext *sc;
> -int size;
> +int size, layout;
>  int32_t yaw, pitch, roll;
>  size_t l = 0, t = 0, r = 0, b = 0;
>  size_t padding = 0;
> @@ -4699,6 +4699,12 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext 
> *pb, MOVAtom atom)
>  avio_skip(pb, 4); /*  version + flags */
>  switch (tag) {
>  case MKTAG('c','b','m','p'):
> +layout = avio_rb32(pb);

Nit: Should be uint32_t, but for a != 0 check i guess int
is sufficient.

LGTM regardless of the above.

> +if (layout) {
> +av_log(c->fc, AV_LOG_WARNING,
> +   "Unsupported cubemap layout %d\n", layout);
> +return 0;
> +}
>  projection = AV_SPHERICAL_CUBEMAP;
>  padding = avio_rb32(pb);
>  break;
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] mov: Fix checking layout and loading padding for cubemaps

2017-03-07 Thread Vittorio Giovara
---
I missed this chunk of review in this version of the set,
sorry, here is the proper patch.
Vittorio

 libavformat/mov.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index cc098cd977..d5c3949050 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4635,7 +4635,7 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 {
 AVStream *st;
 MOVStreamContext *sc;
-int size;
+int size, layout;
 int32_t yaw, pitch, roll;
 size_t l = 0, t = 0, r = 0, b = 0;
 size_t padding = 0;
@@ -4699,6 +4699,12 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 avio_skip(pb, 4); /*  version + flags */
 switch (tag) {
 case MKTAG('c','b','m','p'):
+layout = avio_rb32(pb);
+if (layout) {
+av_log(c->fc, AV_LOG_WARNING,
+   "Unsupported cubemap layout %d\n", layout);
+return 0;
+}
 projection = AV_SPHERICAL_CUBEMAP;
 padding = avio_rb32(pb);
 break;
-- 
2.12.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel