avcodec/snow: fix null pointer dereference in cleanup after allocation failure

Fixes: snowf.avi
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-11 15:36:22 +02:00
parent ba47d519e5
commit 9a162146ca
1 changed files with 1 additions and 1 deletions

View File

@ -703,7 +703,7 @@ av_cold void ff_snow_common_end(SnowContext *s)
for(i=0; i<MAX_REF_FRAMES; i++){
av_freep(&s->ref_mvs[i]);
av_freep(&s->ref_scores[i]);
if(s->last_picture[i]->data[0]) {
if(s->last_picture[i] && s->last_picture[i]->data[0]) {
av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]);
}
av_frame_free(&s->last_picture[i]);