summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2017-11-08 19:17:49 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-13 20:33:10 +0100
commit284b432662b6e137148ff9d13ef2b554cb14b4ae (patch)
treec0ef4d504ae871a66d14c008d2056be9fb19a267
parent237ccd8a165d2128e8c6bcb14c8c6c3e793cfe05 (diff)
downloadffmpeg-284b432662b6e137148ff9d13ef2b554cb14b4ae.tar.gz
avformat/fitsenc: validate input pixel format
Fixes CID #1416961 and #1416962
-rw-r--r--libavformat/fitsenc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
index 7cb171596c..cc3999aa8a 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) {
@@ -166,7 +168,9 @@ static int write_image_header(AVFormatContext *s)
static int fits_write_packet(AVFormatContext *s, AVPacket *pkt)
{
- write_image_header(s);
+ int ret = write_image_header(s);
+ if (ret < 0)
+ return ret;
avio_write(s->pb, pkt->data, pkt->size);
return 0;
}