[vlc-devel] [PATCH] rtp: JPEG packetization

Pierre Ynard linkfanel at yahoo.fr
Thu Oct 4 02:29:16 CEST 2012


+            /* a quantization table is 64 bytes long */
+            i_nb_qtables = GetWBE( &p_data[i + 2] ) / 65;

Doesn't the length include the two bytes of the length field?

+            if( i + 4 + i_nb_qtables * 65 > i_data )
+            {
+                fprintf( stderr, "Too short JPEG header. Aborted!\n" );
+                return VLC_EGENERIC;

Don't use fprintf(). Normally you'd use the msg_{Dbg,Warn,Err} functions
to log messages, but I guess you can just drop them here.

+            }
+
+            p_qtables = &p_data[i + 4];

Instead of this pattern, you could just write "p_data + i + 4".

Regards,

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the vlc-devel mailing list