Mercurial > libavcodec.hg
comparison h264.c @ 7277:2bd9df0236e8 libavcodec
H264: fix index range assert() in remove_short_at_index()
author | mru |
---|---|
date | Mon, 14 Jul 2008 19:17:13 +0000 |
parents | 9a5cdba22eeb |
children | 39e81fdd8d23 |
comparison
equal
deleted
inserted
replaced
7276:6163e7de8604 | 7277:2bd9df0236e8 |
---|---|
3346 * that list. This does no checking on the provided index; it is assumed | 3346 * that list. This does no checking on the provided index; it is assumed |
3347 * to be valid. Other list entries are shifted down. | 3347 * to be valid. Other list entries are shifted down. |
3348 * @param i index into h->short_ref of picture to remove. | 3348 * @param i index into h->short_ref of picture to remove. |
3349 */ | 3349 */ |
3350 static void remove_short_at_index(H264Context *h, int i){ | 3350 static void remove_short_at_index(H264Context *h, int i){ |
3351 assert(i > 0 && i < h->short_ref_count); | 3351 assert(i >= 0 && i < h->short_ref_count); |
3352 h->short_ref[i]= NULL; | 3352 h->short_ref[i]= NULL; |
3353 if (--h->short_ref_count) | 3353 if (--h->short_ref_count) |
3354 memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i)*sizeof(Picture*)); | 3354 memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i)*sizeof(Picture*)); |
3355 } | 3355 } |
3356 | 3356 |