[FFmpeg-devel] [PATCH] avformat/fitsenc: validate input pixel format
Timo Rothenpieler
timo at rothenpieler.org
Mon Nov 13 12:16:09 EET 2017
Fixes CID #1416961 and #1416962
---
libavformat/fitsenc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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;
}
--
2.14.2
More information about the ffmpeg-devel
mailing list