comparison ipmovie.c @ 1800:3edc6f0468be libavformat

not checking error return, resulting double free returning uninitalized pointers
author michael
date Sat, 17 Feb 2007 02:46:47 +0000
parents a782462e2497
children 1a3c9056982a
comparison
equal deleted inserted replaced
1799:0dc3a767943d 1800:3edc6f0468be
225 int audio_flags; 225 int audio_flags;
226 unsigned char r, g, b; 226 unsigned char r, g, b;
227 227
228 /* see if there are any pending packets */ 228 /* see if there are any pending packets */
229 chunk_type = load_ipmovie_packet(s, pb, pkt); 229 chunk_type = load_ipmovie_packet(s, pb, pkt);
230 if ((chunk_type == CHUNK_VIDEO) && (chunk_type != CHUNK_DONE)) 230 if (chunk_type != CHUNK_DONE)
231 return chunk_type; 231 return chunk_type;
232 232
233 /* read the next chunk, wherever the file happens to be pointing */ 233 /* read the next chunk, wherever the file happens to be pointing */
234 if (url_feof(pb)) 234 if (url_feof(pb))
235 return CHUNK_EOF; 235 return CHUNK_EOF;
599 ret = AVERROR_INVALIDDATA; 599 ret = AVERROR_INVALIDDATA;
600 else if (ret == CHUNK_EOF) 600 else if (ret == CHUNK_EOF)
601 ret = AVERROR_IO; 601 ret = AVERROR_IO;
602 else if (ret == CHUNK_NOMEM) 602 else if (ret == CHUNK_NOMEM)
603 ret = AVERROR_NOMEM; 603 ret = AVERROR_NOMEM;
604 else if (ret == CHUNK_VIDEO)
605 ret = 0;
604 else 606 else
605 ret = 0; 607 ret = -1;
606 608
607 return ret; 609 return ret;
608 } 610 }
609 611
610 static int ipmovie_read_close(AVFormatContext *s) 612 static int ipmovie_read_close(AVFormatContext *s)