History

ffv1: Make sure at least one slice context is initialized

This avoids crashes when initializing the range coder for the first slice context.

Martin Storsjö committed 13 years ago

Commit b1db3311 parent ea78a341 file · +4 −0Browse files

Unified · Split

libavcodec/ffv1.c+4−0
@@ -194,6 +194,10 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f) · 193 unmodified lines
194194 int i;
195195
196196 f->slice_count = f->num_h_slices * f->num_v_slices;
197+ if (f->slice_count <= 0) {
198+ av_log(f->avctx, AV_LOG_ERROR, "Invalid number of slices\n");
199+ return AVERROR(EINVAL);
200+ }
197201
198202 for (i = 0; i < f->slice_count; i++) {
199203 FFV1Context *fs = av_mallocz(sizeof(*fs));

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