Showing the changes to libavformat (1 of 1 file). Show all
Unified · Split
| @@ -426,6 +426,10 @@ static int avi_write_header(AVFormatContext *s) · 425 unmodified lines | ||
| 426 | 426 | avio_wl32(pb, -1); /* quality */ |
| 427 | 427 | avio_wl32(pb, au_ssize); /* sample size */ |
| 428 | 428 | avio_wl32(pb, 0); |
| 429 | + if (par->width > 65535 || par->height > 65535) { | |
| 430 | + av_log(s, AV_LOG_ERROR, "%dx%d dimensions are too big\n", par->width, par->height); | |
| 431 | + return AVERROR(EINVAL); | |
| 432 | + } | |
| 429 | 433 | avio_wl16(pb, par->width); |
| 430 | 434 | avio_wl16(pb, par->height); |
| 431 | 435 | ff_end_tag(pb, strh); |