[FFmpeg-devel] Return 0 in case of fail...

canaar at openmailbox.org canaar at openmailbox.org
Fri Nov 6 12:00:18 CET 2015


there's this snippet in ffserver.c :
   len = c->buffer_end - c->buffer_ptr;
                 if (len < 4) {
                     /* fail safe - should never happen */
                 fail1:                                          //I am 
talking about this label fail1
                     c->buffer_ptr = c->buffer_end;
                     return 0;
                 }
                 len = (c->buffer_ptr[0] << 24) |
                     (c->buffer_ptr[1] << 16) |
                     (c->buffer_ptr[2] << 8) |
                     (c->buffer_ptr[3]);
                 if (len > (c->buffer_end - c->buffer_ptr))
                     goto fail1;
1) Why does it return 0 in the case of a fail? It should return -1, 
right?
2) Unable to understand what the c->buffer contains.

Regards,
canaar


More information about the ffmpeg-devel mailing list