History

avformat/mov: add more sanity checks when reading clap boxes

If the apperture window is bigger than the canvas, then the clap box is invalid and there's no point calculating cropping values. Fixes: libavformat/mov.c:1295:14: runtime error: -256 is outside the range of representable values of type 'unsigned long'

James Almer committed 1 year ago

Commit f789d601 parent dbe94e11 file · +5 −0Browse files

Unified · Split

libavformat/mov.c+5−0
@@ -1277,6 +1277,11 @@ static int mov_read_clap(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 1276 unmodified lines
12771277 err = AVERROR_INVALIDDATA;
12781278 goto fail;
12791279 }
1280+ if ((av_cmp_q((AVRational) { width, 1 }, aperture_width) < 0) ||
1281+ (av_cmp_q((AVRational) { height, 1 }, aperture_height) < 0)) {
1282+ err = AVERROR_INVALIDDATA;
1283+ goto fail;
1284+ }
12801285 av_log(c->fc, AV_LOG_TRACE, "clap: apertureWidth %d/%d, apertureHeight %d/%d "
12811286 "horizOff %d/%d vertOff %d/%d\n",
12821287 aperture_width.num, aperture_width.den, aperture_height.num, aperture_height.den,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t