diff mbox

[FFmpeg-devel,5/9] avformat/fitsenc: validate input pixel format

Message ID 20171108181753.6776-6-timo@rothenpieler.org
State Superseded
Headers show

Commit Message

Timo Rothenpieler Nov. 8, 2017, 6:17 p.m. UTC
Fixes CID #1416961 and #1416962
---
 libavformat/fitsenc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paul B Mahol Nov. 8, 2017, 7:03 p.m. UTC | #1
On 11/8/17, Timo Rothenpieler <timo@rothenpieler.org> wrote:
> Fixes CID #1416961 and #1416962
> ---
>  libavformat/fitsenc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
> index 7cb171596c..91411f2606 100644
> --- a/libavformat/fitsenc.c
> +++ b/libavformat/fitsenc.c
> @@ -106,6 +106,8 @@ static int write_image_header(AVFormatContext *s)
>              }
>              bzero = 32768;
>              break;
> +        default:
> +            return AVERROR(EINVAL);
>      }
>
>      if (fitsctx->first_image) {
> --
> 2.14.2
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

ok
Michael Niedermayer Nov. 8, 2017, 8:07 p.m. UTC | #2
On Wed, Nov 08, 2017 at 07:17:49PM +0100, Timo Rothenpieler wrote:
> Fixes CID #1416961 and #1416962
> ---
>  libavformat/fitsenc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
> index 7cb171596c..91411f2606 100644
> --- a/libavformat/fitsenc.c
> +++ b/libavformat/fitsenc.c
> @@ -106,6 +106,8 @@ static int write_image_header(AVFormatContext *s)
>              }
>              bzero = 32768;
>              break;
> +        default:
> +            return AVERROR(EINVAL);
>      }
>  
>      if (fitsctx->first_image) {

this is not sufficient
the return value of write_image_header() is never checked


[...]
diff mbox

Patch

diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
index 7cb171596c..91411f2606 100644
--- a/libavformat/fitsenc.c
+++ b/libavformat/fitsenc.c
@@ -106,6 +106,8 @@  static int write_image_header(AVFormatContext *s)
             }
             bzero = 32768;
             break;
+        default:
+            return AVERROR(EINVAL);
     }
 
     if (fitsctx->first_image) {