Revision 7d894aeb

View differences:

libavformat/rtpdec_xiph.c
178 178

  
179 179
        if (fragmented == 3) {
180 180
            // end of xiph data packet
181
            uint8_t* xiph_data;
182
            int frame_size = url_close_dyn_buf(data->fragment, &xiph_data);
181
            av_init_packet(pkt);
182
            pkt->size = url_close_dyn_buf(data->fragment, &pkt->data);
183 183

  
184
            if (frame_size < 0) {
184
            if (pkt->size < 0) {
185 185
                av_log(ctx, AV_LOG_ERROR,
186 186
                       "Error occurred when getting fragment buffer.");
187
                return frame_size;
187
                return pkt->size;
188 188
            }
189 189

  
190
            if (av_new_packet(pkt, frame_size)) {
191
                av_log(ctx, AV_LOG_ERROR, "Out of memory.\n");
192
                return AVERROR(ENOMEM);
193
            }
194

  
195
            memcpy(pkt->data, xiph_data, frame_size);
196 190
            pkt->stream_index = st->index;
191
            pkt->destruct = av_destruct_packet;
197 192

  
198
            av_free(xiph_data);
199 193
            data->fragment = NULL;
200 194

  
201 195
            return 0;

Also available in: Unified diff