Commit 25012c56 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

filmstripdec: correctly check image dimensions

This prevents a division by zero in read_packet.
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 03cef34a
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
*/ */
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
...@@ -68,10 +69,8 @@ static int read_header(AVFormatContext *s) ...@@ -68,10 +69,8 @@ static int read_header(AVFormatContext *s)
st->codecpar->height = avio_rb16(pb); st->codecpar->height = avio_rb16(pb);
film->leading = avio_rb16(pb); film->leading = avio_rb16(pb);
if (st->codecpar->width * 4LL * st->codecpar->height >= INT_MAX) { if (av_image_check_size(st->codecpar->width, st->codecpar->height, 0, s) < 0)
av_log(s, AV_LOG_ERROR, "dimensions too large\n"); return AVERROR_INVALIDDATA;
return AVERROR_PATCHWELCOME;
}
avpriv_set_pts_info(st, 64, 1, avio_rb16(pb)); avpriv_set_pts_info(st, 64, 1, avio_rb16(pb));
......
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