Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Downs <heydowns@borg.com>2007-09-06 00:04:09 +0400
committerBenoit Fouet <benoit.fouet@free.fr>2007-09-06 00:04:09 +0400
commit088ed4d636e3065bf4fc67ef11bfe8592bcd8c0e (patch)
tree21f5db98235668723a3b38805ae8a6a49e949334 /libavcodec
parent4df7c7d8d67df32402219f0daa26e12f7b56c73a (diff)
Avoid a crash when H264 MMC operation causes the short term reference
list to be emptied. Patch by Jeff Downs: [heydowns borg com] Originally committed as revision 10416 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a4d2a13391..49eaa378c1 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3159,8 +3159,8 @@ static Picture * remove_short(H264Context *h, int frame_num){
av_log(h->s.avctx, AV_LOG_DEBUG, "%d %d %p\n", i, pic->frame_num, pic);
if(pic->frame_num == frame_num){
h->short_ref[i]= NULL;
- memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i - 1)*sizeof(Picture*));
- h->short_ref_count--;
+ if (--h->short_ref_count)
+ memmove(&h->short_ref[i], &h->short_ref[i+1], (h->short_ref_count - i)*sizeof(Picture*));
return pic;
}
}