Mercurial > libavformat.hg
comparison utils.c @ 5103:ccb7812599f4 libavformat
Only free '*ic_ptr' when a caller has pre-allocated a context and passed it in
(wherein av_open_input_file assumes memory ownership).
Patch by Art Clarke a<surname> xuggle com
author | benoit |
---|---|
date | Wed, 15 Jul 2009 10:00:16 +0000 |
parents | 8c0eb348c19b |
children | 798a42ae722f |
comparison
equal
deleted
inserted
replaced
5102:81c37b782fba | 5103:ccb7812599f4 |
---|---|
497 return 0; | 497 return 0; |
498 fail: | 498 fail: |
499 av_freep(&pd->buf); | 499 av_freep(&pd->buf); |
500 if (pb) | 500 if (pb) |
501 url_fclose(pb); | 501 url_fclose(pb); |
502 av_freep(ic_ptr); | 502 if (ap && ap->prealloced_context) |
503 av_free(*ic_ptr); | |
504 *ic_ptr = NULL; | |
503 return err; | 505 return err; |
504 | 506 |
505 } | 507 } |
506 | 508 |
507 /*******************************************************/ | 509 /*******************************************************/ |